diff options
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | icons/readm_launcher.png | bin | 5951 -> 0 bytes | |||
-rw-r--r-- | images/readm_logo.png | bin | 7797 -> 0 bytes | |||
-rw-r--r-- | images/readm_logo_light.png | bin | 14242 -> 0 bytes | |||
-rw-r--r-- | src/Body.cpp | 6 | ||||
-rw-r--r-- | src/QuickMedia.cpp | 57 |
6 files changed, 6 insertions, 61 deletions
@@ -2,13 +2,13 @@ # QuickMedia A rofi inspired native client for web services. -Currently supported web services: `youtube`, `peertube`, `lbry`, `soundcloud`, `nyaa.si`, `manganelo`, `manganelos`, `mangatown`, `mangakatana`, `mangadex`, `readm`, `onimanga`, `4chan`, `matrix`, `saucenao`, `hotexamples`, `anilist`, `dramacool` and _others_.\ +Currently supported web services: `youtube`, `peertube`, `lbry`, `soundcloud`, `nyaa.si`, `manganelo`, `manganelos`, `mangatown`, `mangakatana`, `mangadex`, `onimanga`, `4chan`, `matrix`, `saucenao`, `hotexamples`, `anilist`, `dramacool` and _others_.\ QuickMedia also supports reading local manga and watching local anime, see [local manga](#local-manga) and [local anime](#local-anime) ## Usage ``` usage: quickmedia [plugin|] [--no-video] [--upscale-images] [--upscale-images-always] [--dir <directory>] [--instance <instance>] [-e <window>] [--video-max-height <height>] OPTIONS: - plugin|url The plugin to use. Should be either launcher, 4chan, manga, manganelo, manganelos, mangatown, mangakatana, mangadex, readm, onimanga, local-manga, local-anime, youtube, peertube, lbry, soundcloud, nyaa.si, matrix, saucenao, hotexamples, anilist, dramacool, file-manager or stdin. This can also be a youtube url, youtube channel url or a 4chan thread url + plugin|url The plugin to use. Should be either launcher, 4chan, manga, manganelo, manganelos, mangatown, mangakatana, mangadex, onimanga, local-manga, local-anime, youtube, peertube, lbry, soundcloud, nyaa.si, matrix, saucenao, hotexamples, anilist, dramacool, file-manager or stdin. This can also be a youtube url, youtube channel url or a 4chan thread url --no-video Only play audio when playing a video. Disabled by default --upscale-images Upscale low-resolution manga pages using waifu2x-ncnn-vulkan. Disabled by default --upscale-images-always Upscale manga pages using waifu2x-ncnn-vulkan, no matter what the original image resolution is. Disabled by default diff --git a/icons/readm_launcher.png b/icons/readm_launcher.png Binary files differdeleted file mode 100644 index 43eeccf..0000000 --- a/icons/readm_launcher.png +++ /dev/null diff --git a/images/readm_logo.png b/images/readm_logo.png Binary files differdeleted file mode 100644 index 2c76d3f..0000000 --- a/images/readm_logo.png +++ /dev/null diff --git a/images/readm_logo_light.png b/images/readm_logo_light.png Binary files differdeleted file mode 100644 index 76bf82b..0000000 --- a/images/readm_logo_light.png +++ /dev/null diff --git a/src/Body.cpp b/src/Body.cpp index 7f6a031..2af12c3 100644 --- a/src/Body.cpp +++ b/src/Body.cpp @@ -58,7 +58,7 @@ namespace QuickMedia { body_spacing[BODY_THEME_MINIMAL].body_padding_horizontal = std::floor(10.0f * get_config().scale * get_config().spacing_scale); body_spacing[BODY_THEME_MINIMAL].body_padding_vertical = std::floor(10.0f * get_config().scale * get_config().spacing_scale); - body_spacing[BODY_THEME_MINIMAL].reaction_background_padding_x = std::floor(7.0f * get_config().scale * get_config().spacing_scale); + body_spacing[BODY_THEME_MINIMAL].reaction_background_padding_x = std::floor(10.0f * get_config().scale * get_config().spacing_scale); body_spacing[BODY_THEME_MINIMAL].reaction_background_padding_y = std::floor(5.0f * get_config().scale * get_config().spacing_scale); body_spacing[BODY_THEME_MINIMAL].reaction_spacing_x = std::floor(5.0f * get_config().scale * get_config().spacing_scale); body_spacing[BODY_THEME_MINIMAL].reaction_padding_y = std::floor(7.0f * get_config().scale * get_config().spacing_scale); @@ -75,7 +75,7 @@ namespace QuickMedia { body_spacing[BODY_THEME_MODERN_SPACIOUS].body_padding_horizontal = std::floor(20.0f * get_config().scale * get_config().spacing_scale); body_spacing[BODY_THEME_MODERN_SPACIOUS].body_padding_vertical = std::floor(20.0f * get_config().scale * get_config().spacing_scale); - body_spacing[BODY_THEME_MODERN_SPACIOUS].reaction_background_padding_x = std::floor(7.0f * get_config().scale * get_config().spacing_scale); + body_spacing[BODY_THEME_MODERN_SPACIOUS].reaction_background_padding_x = std::floor(10.0f * get_config().scale * get_config().spacing_scale); body_spacing[BODY_THEME_MODERN_SPACIOUS].reaction_background_padding_y = std::floor(5.0f * get_config().scale * get_config().spacing_scale); body_spacing[BODY_THEME_MODERN_SPACIOUS].reaction_spacing_x = std::floor(5.0f * get_config().scale * get_config().spacing_scale); body_spacing[BODY_THEME_MODERN_SPACIOUS].reaction_padding_y = std::floor(7.0f * get_config().scale * get_config().spacing_scale); @@ -1683,7 +1683,7 @@ namespace QuickMedia { } if(reaction.text) { - reaction.text->set_position(mgl::vec2f(reaction_background.get_position() + mgl::vec2f(body_spacing[body_theme].reaction_background_padding_x, -(float)reaction.text->get_character_size()*0.10f)).floor()); + reaction.text->set_position(mgl::vec2f(reaction_background.get_position() + mgl::vec2f(body_spacing[body_theme].reaction_background_padding_x, body_spacing[body_theme].reaction_background_padding_y-(float)reaction.text->get_character_size()*0.50f)).floor()); } if(draw && reaction.text) { diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index 4de923d..fb96dfb 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -95,7 +95,6 @@ static const std::pair<const char*, Logo> valid_plugins[] = { std::make_pair<const char*, Logo>("mangakatana", "mangakatana_logo.png"), std::make_pair<const char*, Logo>("mangadex", { "mangadex_logo.png", "mangadex_logo_light.png" }), std::make_pair<const char*, Logo>("onimanga", nullptr), - std::make_pair<const char*, Logo>("readm", { "readm_logo.png", "readm_logo_light.png" }), std::make_pair<const char*, Logo>("local-manga", nullptr), std::make_pair<const char*, Logo>("local-anime", nullptr), std::make_pair<const char*, Logo>("manga", nullptr), @@ -342,7 +341,7 @@ namespace QuickMedia { static void usage() { fprintf(stderr, "usage: quickmedia [plugin|url] [--no-video] [--upscale-images] [--upscale-images-always] [--dir <directory>] [--instance <instance>] [-e <window>] [--video-max-height <height>]\n"); fprintf(stderr, "OPTIONS:\n"); - fprintf(stderr, " plugin|url The plugin to use. Should be either launcher, 4chan, manga, manganelo, manganelos, mangatown, mangakatana, mangadex, readm, onimanga, local-manga, local-anime, youtube, peertube, lbry, soundcloud, nyaa.si, matrix, saucenao, hotexamples, anilist, dramacool, file-manager, stdin, pornhub, spankbang, xvideos or xhamster. This can also be a youtube url, youtube channel url or a 4chan thread url\n"); + fprintf(stderr, " plugin|url The plugin to use. Should be either launcher, 4chan, manga, manganelo, manganelos, mangatown, mangakatana, mangadex, onimanga, local-manga, local-anime, youtube, peertube, lbry, soundcloud, nyaa.si, matrix, saucenao, hotexamples, anilist, dramacool, file-manager, stdin, pornhub, spankbang, xvideos or xhamster. This can also be a youtube url, youtube channel url or a 4chan thread url\n"); fprintf(stderr, " --no-video Only play audio when playing a video. Disabled by default\n"); fprintf(stderr, " --upscale-images Upscale low-resolution manga pages using waifu2x-ncnn-vulkan. Disabled by default\n"); fprintf(stderr, " --upscale-images-always Upscale manga pages using waifu2x-ncnn-vulkan, no matter what the original image resolution is. Disabled by default\n"); @@ -365,7 +364,6 @@ namespace QuickMedia { || strcmp(plugin_name, "mangatown") == 0 || strcmp(plugin_name, "mangakatana") == 0 || strcmp(plugin_name, "mangadex") == 0 - || strcmp(plugin_name, "readm") == 0 || strcmp(plugin_name, "onimanga") == 0 || strcmp(plugin_name, "local-manga") == 0; } @@ -984,42 +982,6 @@ namespace QuickMedia { .manga_id_handler("/manga/", nullptr); } - static void add_readm_handlers(MangaGenericSearchPage *manga_generic_search_page) { - manga_generic_search_page->search_post_handler("https://readm.org/service/search", {{"dataType", "json"}, {"phrase", "%s"}}, - [](Json::Value &json_root) { - BodyItems result_items; - if(!json_root.isObject()) - return result_items; - - const Json::Value &manga_json = json_root["manga"]; - if(!manga_json.isArray()) - return result_items; - - for(const Json::Value &item_json : manga_json) { - if(!item_json.isObject()) - continue; - - const Json::Value &title_json = item_json["title"]; - const Json::Value &url_json = item_json["url"]; - const Json::Value &image_json = item_json["image"]; - if(!title_json.isString() || !url_json.isString()) - continue; - - auto body_item = BodyItem::create(strip(title_json.asString())); - body_item->url = strip(url_json.asString()); - if(image_json.isString()) - body_item->thumbnail_url = strip(image_json.asString()); - result_items.push_back(std::move(body_item)); - } - - return result_items; - }) - .list_chapters_handler("//div[class='episodes-list']//a", "text", "href", "/manga/") - .list_chapters_uploaded_time_handler("//div[class='episodes-list']//td[class='episode-date']", "text", nullptr) - .list_page_images_handler("//div[id='content']//img", "src", "/chapter_files/") - .manga_id_handler("/manga/", "/"); - } - static void add_onimanga_handlers(MangaGenericSearchPage *manga_generic_search_page) { manga_generic_search_page->search_handler("https://onimanga.com/search?search=%s", 1) .text_handler({{"//li[class='manga-name']/a", "text", "href", nullptr}}) @@ -1167,7 +1129,6 @@ namespace QuickMedia { create_launcher_body_item("Manganelos", "manganelos", resources_root + "icons/manganelos_launcher.png"), create_launcher_body_item("Mangatown", "mangatown", resources_root + "icons/mangatown_launcher.png", resources_root + "icons/mangatown_launcher_light.png"), create_launcher_body_item("Onimanga", "onimanga", ""), - create_launcher_body_item("Readm", "readm", resources_root + "icons/readm_launcher.png"), create_launcher_body_item("Matrix", "matrix", resources_root + "icons/matrix_launcher.png"), create_launcher_body_item("Nyaa.si", "nyaa.si", resources_root + "icons/nyaa_si_launcher.png"), create_launcher_body_item("PeerTube", "peertube", resources_root + "images/peertube_logo.png"), @@ -1236,17 +1197,6 @@ namespace QuickMedia { tabs.push_back(Tab{create_body(), std::move(history_page), create_search_bar("Search...", SEARCH_DELAY_FILTER)}); start_tab_index = 1; - } else if(strcmp(plugin_name, "readm") == 0) { - auto search_page = std::make_unique<MangaGenericSearchPage>(this, plugin_name, "https://readm.org/"); - add_readm_handlers(search_page.get()); - - tabs.push_back(Tab{create_body(), std::make_unique<BookmarksPage>(this, search_page.get()), create_search_bar("Search...", SEARCH_DELAY_FILTER)}); - tabs.push_back(Tab{create_body(), std::move(search_page), create_search_bar("Search...", 400)}); - - auto history_page = std::make_unique<HistoryPage>(this, tabs.back().page.get(), HistoryType::MANGA); - tabs.push_back(Tab{create_body(), std::move(history_page), create_search_bar("Search...", SEARCH_DELAY_FILTER)}); - - start_tab_index = 1; } else if(strcmp(plugin_name, "onimanga") == 0) { auto search_page = std::make_unique<MangaGenericSearchPage>(this, plugin_name, "https://onimanga.com/"); add_onimanga_handlers(search_page.get()); @@ -1295,8 +1245,6 @@ namespace QuickMedia { add_mangakatana_handlers(mangakatana.get()); auto onimanga = std::make_unique<MangaGenericSearchPage>(this, "onimanga", "https://onimanga.com/"); add_onimanga_handlers(onimanga.get()); - auto readm = std::make_unique<MangaGenericSearchPage>(this, "readm", "https://readm.org/"); - add_readm_handlers(readm.get()); auto local_manga = std::make_unique<LocalMangaSearchPage>(this, false); // TODO: Use async task pool @@ -1306,7 +1254,6 @@ namespace QuickMedia { pages.push_back({std::move(mangatown), "Mangatown", "mangatown"}); pages.push_back({std::move(mangakatana), "Mangakatana", "mangakatana"}); pages.push_back({std::move(onimanga), "Onimanga", "onimanga"}); - pages.push_back({std::move(readm), "Readm", "readm"}); pages.push_back({std::move(mangadex), "Mangadex", "mangadex"}); if(!get_config().local_manga.directory.empty()) @@ -1834,8 +1781,6 @@ namespace QuickMedia { body_item->url = "https://mangakatana.com/manga/" + manga_id; else if(strcmp(plugin_name, "onimanga") == 0) body_item->url = "https://onimanga.com/" + manga_id; - else if(strcmp(plugin_name, "readm") == 0) - body_item->url = "https://readm.org/manga/" + manga_id; else if(strcmp(plugin_name, "local-manga") == 0) body_item->url = manga_id; else |