diff --git a/.github/workflows/gen_index.yml b/.github/workflows/gen_index.yml index b1a0709c..01c92b8b 100644 --- a/.github/workflows/gen_index.yml +++ b/.github/workflows/gen_index.yml @@ -27,5 +27,6 @@ jobs: git checkout main git add index.json git add anime_index.json + git add novel_index.json git commit -m "Update extensions" git push origin main --force \ No newline at end of file diff --git a/dart/anime/multisrc/datalifeengine/src/frenchanime/frenchanime.dart b/dart/anime/multisrc/datalifeengine/src/frenchanime/frenchanime.dart index f28491dc..719dcece 100644 --- a/dart/anime/multisrc/datalifeengine/src/frenchanime/frenchanime.dart +++ b/dart/anime/multisrc/datalifeengine/src/frenchanime/frenchanime.dart @@ -7,7 +7,7 @@ Source _frenchanimeSource = Source( baseUrl: "https://french-anime.com", lang: "fr", typeSource: "datalifeengine", - isManga: false, + itemType: ItemType.anime, iconUrl: "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/multisrc/datalifeengine/src/frenchanime/icon.png", ); diff --git a/dart/anime/multisrc/datalifeengine/src/wiflix/wiflix.dart b/dart/anime/multisrc/datalifeengine/src/wiflix/wiflix.dart index c5cb9064..c4682ee4 100644 --- a/dart/anime/multisrc/datalifeengine/src/wiflix/wiflix.dart +++ b/dart/anime/multisrc/datalifeengine/src/wiflix/wiflix.dart @@ -7,7 +7,7 @@ Source _wiflixSource = Source( baseUrl: "https://wiflix-hd.vip", lang: "fr", typeSource: "datalifeengine", - isManga: false, + itemType: ItemType.anime, iconUrl: "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/multisrc/datalifeengine/src/wiflix/icon.png", ); diff --git a/dart/anime/multisrc/dopeflix/src/dopebox/dopebox.dart b/dart/anime/multisrc/dopeflix/src/dopebox/dopebox.dart index 2029e53f..ef8a39c7 100644 --- a/dart/anime/multisrc/dopeflix/src/dopebox/dopebox.dart +++ b/dart/anime/multisrc/dopeflix/src/dopebox/dopebox.dart @@ -7,7 +7,7 @@ Source _dopeboxSource = Source( baseUrl: "https://dopebox.to", lang: "en", typeSource: "dopeflix", - isManga: false, + itemType: ItemType.anime, iconUrl: "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/multisrc/dopeflix/src/dopebox/icon.png", ); diff --git a/dart/anime/multisrc/dopeflix/src/sflix/sflix.dart b/dart/anime/multisrc/dopeflix/src/sflix/sflix.dart index 89d420a4..c19dbd1e 100644 --- a/dart/anime/multisrc/dopeflix/src/sflix/sflix.dart +++ b/dart/anime/multisrc/dopeflix/src/sflix/sflix.dart @@ -7,7 +7,7 @@ Source _sflixSource = Source( baseUrl: "https://sflix.to", lang: "en", typeSource: "dopeflix", - isManga: false, + itemType: ItemType.anime, iconUrl: "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/multisrc/dopeflix/src/sflix/icon.png", ); diff --git a/dart/anime/multisrc/zorotheme/src/hianime/hianime.dart b/dart/anime/multisrc/zorotheme/src/hianime/hianime.dart index 86b54428..27bc3449 100644 --- a/dart/anime/multisrc/zorotheme/src/hianime/hianime.dart +++ b/dart/anime/multisrc/zorotheme/src/hianime/hianime.dart @@ -6,7 +6,7 @@ Source _aniwatchSource = Source( id: 814067600, name: "HiAnime", baseUrl: "https://hianime.to", - isManga: false, + itemType: ItemType.anime, lang: "en", typeSource: "zorotheme", iconUrl: diff --git a/dart/anime/multisrc/zorotheme/src/kaido/kaido.dart b/dart/anime/multisrc/zorotheme/src/kaido/kaido.dart index 7270c8cb..59929d21 100644 --- a/dart/anime/multisrc/zorotheme/src/kaido/kaido.dart +++ b/dart/anime/multisrc/zorotheme/src/kaido/kaido.dart @@ -6,7 +6,7 @@ Source _kaidoSource = Source( name: "Kaido.to", baseUrl: "https://kaido.to", lang: "en", - isManga: false, + itemType: ItemType.anime, typeSource: "zorotheme", iconUrl: "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/multisrc/zorotheme/src/kaido/icon.png", diff --git a/dart/anime/src/all/animeworldindia/sources.dart b/dart/anime/src/all/animeworldindia/sources.dart index 52db9e30..7d5e80e8 100644 --- a/dart/anime/src/all/animeworldindia/sources.dart +++ b/dart/anime/src/all/animeworldindia/sources.dart @@ -28,6 +28,6 @@ List _animeworldindiaSourcesList = _languages typeSource: "multiple", iconUrl: _iconUrl, version: _animeworldindiaVersion, - isManga: false, + itemType: ItemType.anime, sourceCodeUrl: _animeworldindiaSourceCodeUrl)) .toList(); diff --git a/dart/anime/src/all/nyaa/source.dart b/dart/anime/src/all/nyaa/source.dart index b557f5d0..2bae1c60 100644 --- a/dart/anime/src/all/nyaa/source.dart +++ b/dart/anime/src/all/nyaa/source.dart @@ -15,5 +15,5 @@ Source _nyaaSource = Source( typeSource: "torrent", iconUrl: _iconUrl, version: _nyaaVersion, - isManga: false, + itemType: ItemType.anime, sourceCodeUrl: _nyaaSourceCodeUrl); diff --git a/dart/anime/src/ar/okanime/source.dart b/dart/anime/src/ar/okanime/source.dart index 64ab435d..ac354883 100644 --- a/dart/anime/src/ar/okanime/source.dart +++ b/dart/anime/src/ar/okanime/source.dart @@ -13,4 +13,4 @@ Source _okanimeSource = Source( "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/ar/okanime/icon.png", sourceCodeUrl: _okanimeSourceCodeUrl, version: _okanimeVersion, - isManga: false); + itemType: ItemType.anime); diff --git a/dart/anime/src/de/animetoast/source.dart b/dart/anime/src/de/animetoast/source.dart index f3b6e160..e472a65c 100644 --- a/dart/anime/src/de/animetoast/source.dart +++ b/dart/anime/src/de/animetoast/source.dart @@ -13,4 +13,4 @@ Source _animetoast = Source( "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/de/animetoast/icon.png", sourceCodeUrl: _animetoastCodeUrl, version: _animetoastVersion, - isManga: false); + itemType: ItemType.anime); diff --git a/dart/anime/src/en/animepahe/source.dart b/dart/anime/src/en/animepahe/source.dart index 2c859425..a474cbeb 100644 --- a/dart/anime/src/en/animepahe/source.dart +++ b/dart/anime/src/en/animepahe/source.dart @@ -13,4 +13,4 @@ Source _animepaheSource = Source( "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/en/animepahe/icon.png", sourceCodeUrl: _animepaheSourceCodeUrl, version: _animepaheVersion, - isManga: false); + itemType: ItemType.anime); diff --git a/dart/anime/src/en/dramacool/source.dart b/dart/anime/src/en/dramacool/source.dart index f70146c6..7c0cb4cd 100644 --- a/dart/anime/src/en/dramacool/source.dart +++ b/dart/anime/src/en/dramacool/source.dart @@ -13,4 +13,4 @@ Source _dramacoolSource = Source( "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/en/dramacool/icon.png", sourceCodeUrl: _dramacoolSourceCodeUrl, version: _dramacoolVersion, - isManga: false); + itemType: ItemType.anime); diff --git a/dart/anime/src/en/gogoanime/source.dart b/dart/anime/src/en/gogoanime/source.dart index 0529962b..90640b1f 100644 --- a/dart/anime/src/en/gogoanime/source.dart +++ b/dart/anime/src/en/gogoanime/source.dart @@ -13,4 +13,4 @@ Source _gogoanimeSource = Source( "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/en/gogoanime/icon.png", sourceCodeUrl: _gogoanimeSourceCodeUrl, version: _gogoanimeVersion, - isManga: false); + itemType: ItemType.anime); diff --git a/dart/anime/src/en/kisskh/source.dart b/dart/anime/src/en/kisskh/source.dart index 26cc5a10..c4405238 100644 --- a/dart/anime/src/en/kisskh/source.dart +++ b/dart/anime/src/en/kisskh/source.dart @@ -13,4 +13,4 @@ Source _kisskhSource = Source( "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/en/kisskh/icon.png", sourceCodeUrl: _kisskhSourceCodeUrl, version: _kisskhVersion, - isManga: false); + itemType: ItemType.anime); diff --git a/dart/anime/src/en/nineanimetv/source.dart b/dart/anime/src/en/nineanimetv/source.dart index d568ea93..c57ada38 100644 --- a/dart/anime/src/en/nineanimetv/source.dart +++ b/dart/anime/src/en/nineanimetv/source.dart @@ -13,4 +13,4 @@ Source _nineanimetv = Source( "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/en/nineanimetv/icon.png", sourceCodeUrl: _nineanimetvCodeUrl, version: _nineanimetvVersion, - isManga: false); + itemType: ItemType.anime); diff --git a/dart/anime/src/en/uhdmovies/source.dart b/dart/anime/src/en/uhdmovies/source.dart index 8cb2eb8f..00014bc9 100644 --- a/dart/anime/src/en/uhdmovies/source.dart +++ b/dart/anime/src/en/uhdmovies/source.dart @@ -13,4 +13,4 @@ Source _uhdmoviesSource = Source( "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/en/uhdmovies/icon.png", sourceCodeUrl: _uhdmoviesSourceCodeUrl, version: _uhdmoviesVersion, - isManga: false); + itemType: ItemType.anime); diff --git a/dart/anime/src/es/animeonlineninja/source.dart b/dart/anime/src/es/animeonlineninja/source.dart index c6b5eac8..c3036b40 100644 --- a/dart/anime/src/es/animeonlineninja/source.dart +++ b/dart/anime/src/es/animeonlineninja/source.dart @@ -13,4 +13,4 @@ Source _animeonlineninjaSource = Source( "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/es/animeonlineninja/icon.png", sourceCodeUrl: _animeonlineninjaSourceCodeUrl, version: _animeonlineninjaVersion, - isManga: false); + itemType: ItemType.anime); diff --git a/dart/anime/src/fr/animesama/source.dart b/dart/anime/src/fr/animesama/source.dart index 18baefe3..bc99cc92 100644 --- a/dart/anime/src/fr/animesama/source.dart +++ b/dart/anime/src/fr/animesama/source.dart @@ -13,4 +13,4 @@ Source _animesama = Source( "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/fr/animesama/icon.png", sourceCodeUrl: animesamaCodeUrl, version: animesamaVersion, - isManga: false); + itemType: ItemType.anime); diff --git a/dart/anime/src/fr/animesultra/source.dart b/dart/anime/src/fr/animesultra/source.dart index 2fbc1c92..cfb16690 100644 --- a/dart/anime/src/fr/animesultra/source.dart +++ b/dart/anime/src/fr/animesultra/source.dart @@ -13,5 +13,5 @@ Source _animesultraSource = Source( "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/fr/animesultra/icon.png", sourceCodeUrl: _animesultraSourceCodeUrl, version: _animesultraVersion, - isManga: false, + itemType: ItemType.anime, isFullData: false); diff --git a/dart/anime/src/fr/anizone/source.dart b/dart/anime/src/fr/anizone/source.dart index 4caf9537..3c1fa693 100644 --- a/dart/anime/src/fr/anizone/source.dart +++ b/dart/anime/src/fr/anizone/source.dart @@ -13,4 +13,4 @@ Source _aniZoneSource = Source( "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/fr/anizone/icon.png", sourceCodeUrl: _aniZoneSourceCodeUrl, version: _aniZoneVersion, - isManga: false); + itemType: ItemType.anime); diff --git a/dart/anime/src/fr/franime/source.dart b/dart/anime/src/fr/franime/source.dart index c91f0113..22b5a5b8 100644 --- a/dart/anime/src/fr/franime/source.dart +++ b/dart/anime/src/fr/franime/source.dart @@ -14,5 +14,5 @@ Source _franimeSource = Source( "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/fr/franime/icon.png", sourceCodeUrl: _franimeSourceCodeUrl, version: _franimeVersion, - isManga: false, + itemType: ItemType.anime, isFullData: true); diff --git a/dart/anime/src/fr/otakufr/source.dart b/dart/anime/src/fr/otakufr/source.dart index 1c12b2b5..8670a8f9 100644 --- a/dart/anime/src/fr/otakufr/source.dart +++ b/dart/anime/src/fr/otakufr/source.dart @@ -13,5 +13,5 @@ Source _otakufr = Source( "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/fr/otakufr/icon.png", sourceCodeUrl: otakufrCodeUrl, version: otakufrVersion, - isManga: false, + itemType: ItemType.anime, isFullData: false); diff --git a/dart/anime/src/hi/yomovies/source.dart b/dart/anime/src/hi/yomovies/source.dart index a6df350c..39d2e5d1 100644 --- a/dart/anime/src/hi/yomovies/source.dart +++ b/dart/anime/src/hi/yomovies/source.dart @@ -13,4 +13,4 @@ Source _yomoviesSource = Source( "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/hi/yomovies/icon.png", sourceCodeUrl: _yomoviesSourceCodeUrl, version: _yomoviesVersion, - isManga: false); + itemType: ItemType.anime); diff --git a/dart/anime/src/id/nimegami/source.dart b/dart/anime/src/id/nimegami/source.dart index 1468aca8..1c009109 100644 --- a/dart/anime/src/id/nimegami/source.dart +++ b/dart/anime/src/id/nimegami/source.dart @@ -13,4 +13,4 @@ Source _nimegami = Source( "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/id/nimegami/icon.png", sourceCodeUrl: _nimegamiCodeUrl, version: _nimegamiVersion, - isManga: false); + itemType: ItemType.anime); diff --git a/dart/anime/src/id/oploverz/source.dart b/dart/anime/src/id/oploverz/source.dart index 4083f29f..d1ec05ba 100644 --- a/dart/anime/src/id/oploverz/source.dart +++ b/dart/anime/src/id/oploverz/source.dart @@ -13,4 +13,4 @@ Source _oploverz = Source( "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/id/oploverz/icon.png", sourceCodeUrl: _oploverzCodeUrl, version: _oploverzVersion, - isManga: false); + itemType: ItemType.anime); diff --git a/dart/anime/src/id/otakudesu/source.dart b/dart/anime/src/id/otakudesu/source.dart index 288b4050..f91ae909 100644 --- a/dart/anime/src/id/otakudesu/source.dart +++ b/dart/anime/src/id/otakudesu/source.dart @@ -13,4 +13,4 @@ Source _otakudesu = Source( "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/id/otakudesu/icon.png", sourceCodeUrl: _otakudesuCodeUrl, version: _otakudesuVersion, - isManga: false); + itemType: ItemType.anime); diff --git a/dart/anime/src/it/animesaturn/source.dart b/dart/anime/src/it/animesaturn/source.dart index bbfd3ec3..442e746c 100644 --- a/dart/anime/src/it/animesaturn/source.dart +++ b/dart/anime/src/it/animesaturn/source.dart @@ -13,4 +13,4 @@ Source _animesaturn = Source( "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/it/animesaturn/icon.png", sourceCodeUrl: _animesaturnCodeUrl, version: _animesaturnVersion, - isManga: false); + itemType: ItemType.anime); diff --git a/dart/anime/src/pt/animesvision/source.dart b/dart/anime/src/pt/animesvision/source.dart index e2aa1711..183c192e 100644 --- a/dart/anime/src/pt/animesvision/source.dart +++ b/dart/anime/src/pt/animesvision/source.dart @@ -13,4 +13,4 @@ Source _animesvision = Source( "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/pt/animesvision/icon.png", sourceCodeUrl: _animesvisionCodeUrl, version: _animesvisionVersion, - isManga: false); + itemType: ItemType.anime); diff --git a/dart/anime/src/sq/filma24/source.dart b/dart/anime/src/sq/filma24/source.dart index d26ea58c..2b085406 100644 --- a/dart/anime/src/sq/filma24/source.dart +++ b/dart/anime/src/sq/filma24/source.dart @@ -13,4 +13,4 @@ Source _filma24 = Source( "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/sq/filma24/icon.png", sourceCodeUrl: _filma24CodeUrl, version: _filma24Version, - isManga: false); + itemType: ItemType.anime); diff --git a/dart/anime/src/tr/diziwatch/source.dart b/dart/anime/src/tr/diziwatch/source.dart index fdef5bc5..d13cc343 100644 --- a/dart/anime/src/tr/diziwatch/source.dart +++ b/dart/anime/src/tr/diziwatch/source.dart @@ -13,4 +13,4 @@ Source _diziwatchSource = Source( "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/tr/diziwatch/icon.png", sourceCodeUrl: _diziwatchSourceCodeUrl, version: _diziwatchVersion, - isManga: false); + itemType: ItemType.anime); diff --git a/dart/manga/multisrc/madara/sources.dart b/dart/manga/multisrc/madara/sources.dart index d31f89e5..01043613 100644 --- a/dart/manga/multisrc/madara/sources.dart +++ b/dart/manga/multisrc/madara/sources.dart @@ -571,6 +571,7 @@ List _madaraSourcesList = [ webtoonhattiSource, ] .map((e) => e + ..itemType = ItemType.manga ..sourceCodeUrl = madaraSourceCodeUrl ..version = madaraVersion) .toList(); diff --git a/dart/manga/multisrc/mangabox/sources.dart b/dart/manga/multisrc/mangabox/sources.dart index 9d6ebeb2..8ba94a88 100644 --- a/dart/manga/multisrc/mangabox/sources.dart +++ b/dart/manga/multisrc/mangabox/sources.dart @@ -20,6 +20,7 @@ List _mangaboxSourcesList = [ manganatoSource ] .map((e) => e + ..itemType = ItemType.manga ..sourceCodeUrl = mangaboxSourceCodeUrl ..version = mangaboxVersion) .toList(); diff --git a/dart/manga/multisrc/mangareader/sources.dart b/dart/manga/multisrc/mangareader/sources.dart index bd65a208..f8f0863c 100644 --- a/dart/manga/multisrc/mangareader/sources.dart +++ b/dart/manga/multisrc/mangareader/sources.dart @@ -289,6 +289,7 @@ List _mangareaderSourcesList = [ zenithscansSource ] .map((e) => e + ..itemType = ItemType.manga ..sourceCodeUrl = mangareaderSourceCodeUrl ..version = mangareaderVersion) .toList(); diff --git a/dart/manga/multisrc/mmrcms/sources.dart b/dart/manga/multisrc/mmrcms/sources.dart index 57164115..cbcc621d 100644 --- a/dart/manga/multisrc/mmrcms/sources.dart +++ b/dart/manga/multisrc/mmrcms/sources.dart @@ -32,6 +32,7 @@ List _mmrcmsSourcesList = [ mangafrSource, ] .map((e) => e + ..itemType = ItemType.manga ..sourceCodeUrl = mmrcmsSourceCodeUrl ..version = mmrcmsVersion) .toList(); diff --git a/dart/manga/multisrc/nepnep/sources.dart b/dart/manga/multisrc/nepnep/sources.dart index e191c8e0..f71f1929 100644 --- a/dart/manga/multisrc/nepnep/sources.dart +++ b/dart/manga/multisrc/nepnep/sources.dart @@ -15,6 +15,7 @@ List _nepnepSourcesList = [ mangalifeSource, ] .map((e) => e + ..itemType = ItemType.manga ..sourceCodeUrl = nepnepSourceCodeUrl ..version = nepnepVersion) .toList(); diff --git a/dart/manga/src/all/comick/sources.dart b/dart/manga/src/all/comick/sources.dart index 1fe49c0a..dbfb1b61 100644 --- a/dart/manga/src/all/comick/sources.dart +++ b/dart/manga/src/all/comick/sources.dart @@ -67,5 +67,6 @@ List _comickSourcesList = _languages isNsfw: _isNsfw, dateFormatLocale: "en", version: _comickVersion, + itemType: ItemType.manga, sourceCodeUrl: _comickSourceCodeUrl)) .toList(); diff --git a/dart/manga/src/all/mangadex/sources.dart b/dart/manga/src/all/mangadex/sources.dart index f7f2089c..ff1def04 100644 --- a/dart/manga/src/all/mangadex/sources.dart +++ b/dart/manga/src/all/mangadex/sources.dart @@ -70,5 +70,6 @@ List _mangaDexSourcesList = _languages isNsfw: _isNsfw, dateFormatLocale: 'en_Us', version: _mangadexVersion, + itemType: ItemType.manga, sourceCodeUrl: _mangadexSourceCodeUrl)) .toList(); diff --git a/dart/manga/src/en/mangahere/source.dart b/dart/manga/src/en/mangahere/source.dart index 095f6fe0..789e1d84 100644 --- a/dart/manga/src/en/mangahere/source.dart +++ b/dart/manga/src/en/mangahere/source.dart @@ -12,6 +12,7 @@ Source _mangahereSource = Source( iconUrl: "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/manga/src/en/mangahere/icon.png", sourceCodeUrl: _mangahereSourceCodeUrl, + itemType: ItemType.manga, version: _mangahereVersion, dateFormat: "MMM dd,yyyy", dateFormatLocale: "en", diff --git a/dart/novel/novel_source_list.dart b/dart/novel/novel_source_list.dart new file mode 100644 index 00000000..51a1594a --- /dev/null +++ b/dart/novel/novel_source_list.dart @@ -0,0 +1,4 @@ +import '../../model/source.dart'; + +List dartNovelSourceList = [ +]; diff --git a/javascript/anime/src/de/aniworld.js b/javascript/anime/src/de/aniworld.js index fbfd7e2a..7f8e5bd4 100644 --- a/javascript/anime/src/de/aniworld.js +++ b/javascript/anime/src/de/aniworld.js @@ -5,7 +5,7 @@ const mangayomiSources = [{ "apiUrl": "", "iconUrl": "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/javascript/icon/de.aniworld.png", "typeSource": "single", - "isManga": false, + "itemType": 1, "isNsfw": false, "version": "0.3.2", "dateFormat": "", diff --git a/javascript/anime/src/de/serienstream.js b/javascript/anime/src/de/serienstream.js index 43db6f1d..e85ae73a 100644 --- a/javascript/anime/src/de/serienstream.js +++ b/javascript/anime/src/de/serienstream.js @@ -5,7 +5,7 @@ const mangayomiSources = [{ "apiUrl": "", "iconUrl": "https://s.to/favicon.ico", "typeSource": "single", - "isManga": false, + "itemType": 1, "isNsfw": false, "version": "0.0.4", "dateFormat": "", diff --git a/javascript/anime/src/en/allanime.js b/javascript/anime/src/en/allanime.js index bb6aeea1..f1af692d 100644 --- a/javascript/anime/src/en/allanime.js +++ b/javascript/anime/src/en/allanime.js @@ -5,7 +5,7 @@ const mangayomiSources = [{ "apiUrl": "https://api.allanime.day/api", "iconUrl": "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/javascript/icon/en.allanime.png", "typeSource": "single", - "isManga": false, + "itemType": 1, "isNsfw": false, "version": "0.0.35", "dateFormat": "", diff --git a/javascript/anime/src/es/animefenix.js b/javascript/anime/src/es/animefenix.js index 659dd575..922295ca 100644 --- a/javascript/anime/src/es/animefenix.js +++ b/javascript/anime/src/es/animefenix.js @@ -5,7 +5,7 @@ const mangayomiSources = [{ "apiUrl": "", "iconUrl": "https://www3.animefenix.tv/themes/fenix-neo/images/AveFenix.png", "typeSource": "single", - "isManga": false, + "itemType": 1, "version": "0.1.13", "dateFormat": "", "dateFormatLocale": "", diff --git a/javascript/anime/src/es/animeflv.js b/javascript/anime/src/es/animeflv.js index 06ace0bd..0a3a7eda 100644 --- a/javascript/anime/src/es/animeflv.js +++ b/javascript/anime/src/es/animeflv.js @@ -5,7 +5,7 @@ const mangayomiSources = [{ "apiUrl": "", "iconUrl": "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/javascript/icon/es.animeflv.png", "typeSource": "single", - "isManga": false, + "itemType": 1, "isNsfw": false, "version": "0.0.1", "dateFormat": "", diff --git a/javascript/anime/src/es/jkanime.js b/javascript/anime/src/es/jkanime.js index 0806650b..5c28f689 100644 --- a/javascript/anime/src/es/jkanime.js +++ b/javascript/anime/src/es/jkanime.js @@ -5,7 +5,7 @@ const mangayomiSources = [{ "apiUrl": "", "iconUrl": "https://cdn.jkanime.net/logo_jk.png", "typeSource": "single", - "isManga": false, + "itemType": 1, "version": "0.1.13", "dateFormat": "", "dateFormatLocale": "", diff --git a/javascript/anime/src/es/tioanime.js b/javascript/anime/src/es/tioanime.js index dfdf0592..e7a6e18a 100644 --- a/javascript/anime/src/es/tioanime.js +++ b/javascript/anime/src/es/tioanime.js @@ -5,7 +5,7 @@ const mangayomiSources = [{ "apiUrl": "", "iconUrl": "https://tioanime.com/assets/img/tio_fb.jpg", "typeSource": "single", - "isManga": false, + "itemType": 1, "version": "0.1.12", "dateFormat": "", "dateFormatLocale": "", diff --git a/javascript/anime/src/zh/360zy.js b/javascript/anime/src/zh/360zy.js index c0a59e36..4ee378f5 100644 --- a/javascript/anime/src/zh/360zy.js +++ b/javascript/anime/src/zh/360zy.js @@ -5,7 +5,7 @@ const mangayomiSources = [{ "apiUrl": "", "iconUrl": "https://360zy.com/favicon.ico", "typeSource": "single", - "isManga": false, + "itemType": 1, "isNsfw": false, "version": "0.0.1", "dateFormat": "", diff --git a/javascript/anime/src/zh/ffzy.js b/javascript/anime/src/zh/ffzy.js index f9dd2184..dbd79752 100644 --- a/javascript/anime/src/zh/ffzy.js +++ b/javascript/anime/src/zh/ffzy.js @@ -5,7 +5,7 @@ const mangayomiSources = [{ "apiUrl": "", "iconUrl": "http://ffzy.tv/template/default/img/favicon.png", "typeSource": "single", - "isManga": false, + "itemType": 1, "isNsfw": false, "version": "0.0.1", "dateFormat": "", diff --git a/javascript/anime/src/zh/huaweiba.js b/javascript/anime/src/zh/huaweiba.js index 200de6f7..3f109ba3 100644 --- a/javascript/anime/src/zh/huaweiba.js +++ b/javascript/anime/src/zh/huaweiba.js @@ -5,7 +5,7 @@ const mangayomiSources = [{ "apiUrl": "", "iconUrl": "https://huaweiba.live/template/ziyuan/images/logo2.png", "typeSource": "single", - "isManga": false, + "itemType": 1, "isNsfw": false, "version": "0.0.1", "dateFormat": "", diff --git a/javascript/anime/src/zh/jisuzy.js b/javascript/anime/src/zh/jisuzy.js index 7600ceb4..0c4f0fb8 100644 --- a/javascript/anime/src/zh/jisuzy.js +++ b/javascript/anime/src/zh/jisuzy.js @@ -5,7 +5,7 @@ const mangayomiSources = [{ "apiUrl": "", "iconUrl": "https://www.jisuzy.com/template/default/images/site_logo.png", "typeSource": "single", - "isManga": false, + "itemType": 1, "isNsfw": false, "version": "0.0.1", "dateFormat": "", diff --git a/javascript/anime/src/zh/mikan.js b/javascript/anime/src/zh/mikan.js index 3fabbb92..d97bd614 100644 --- a/javascript/anime/src/zh/mikan.js +++ b/javascript/anime/src/zh/mikan.js @@ -5,7 +5,7 @@ const mangayomiSources = [{ "apiUrl": "", "iconUrl": "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/javascript/icon/zh.mikan.png", "typeSource": "torrent", - "isManga": false, + "itemType": 1, "isNsfw": false, "version": "0.0.2", "dateFormat": "", diff --git a/javascript/anime/src/zh/tiankongzy.js b/javascript/anime/src/zh/tiankongzy.js index e9d21096..06d0906d 100644 --- a/javascript/anime/src/zh/tiankongzy.js +++ b/javascript/anime/src/zh/tiankongzy.js @@ -5,7 +5,7 @@ const mangayomiSources = [{ "apiUrl": "", "iconUrl": "https://api.tiankongapi.com/template/v10012/images/logo.jpg", "typeSource": "single", - "isManga": false, + "itemType": 1, "isNsfw": false, "version": "0.0.1", "dateFormat": "", diff --git a/javascript/anime/src/zh/wogg.js b/javascript/anime/src/zh/wogg.js index 20112134..ab606811 100644 --- a/javascript/anime/src/zh/wogg.js +++ b/javascript/anime/src/zh/wogg.js @@ -5,7 +5,7 @@ const mangayomiSources = [{ "apiUrl": "", "iconUrl": "https://imgsrc.baidu.com/forum/pic/item/4b90f603738da977d5da660af651f8198618e31f.jpg", "typeSource": "single", - "isManga": false, + "itemType": 1, "isNsfw": false, "version": "0.0.2", "dateFormat": "", diff --git a/javascript/anime/src/zh/yhdm.js b/javascript/anime/src/zh/yhdm.js index feade271..5a64d3bf 100644 --- a/javascript/anime/src/zh/yhdm.js +++ b/javascript/anime/src/zh/yhdm.js @@ -5,7 +5,7 @@ const mangayomiSources = [{ "apiUrl": "", "iconUrl": "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/javascript/icon/zh.yhdm.png", "typeSource": "single", - "isManga": false, + "itemType": 1, "isNsfw": false, "version": "0.0.2", "dateFormat": "", diff --git a/javascript/anime/src/zh/yydsys.js b/javascript/anime/src/zh/yydsys.js index bcfc74f7..40787d71 100644 --- a/javascript/anime/src/zh/yydsys.js +++ b/javascript/anime/src/zh/yydsys.js @@ -5,7 +5,7 @@ const mangayomiSources = [{ "apiUrl": "", "iconUrl": "https://tv.yydsys.top/template/DYXS2/static/picture/logo.png", "typeSource": "single", - "isManga": false, + "itemType": 1, "isNsfw": false, "version": "0.0.2", "dateFormat": "", diff --git a/javascript/icon/en.novelupdates.png b/javascript/icon/en.novelupdates.png new file mode 100644 index 00000000..a58a7666 Binary files /dev/null and b/javascript/icon/en.novelupdates.png differ diff --git a/javascript/manga/src/all/mangafire.js b/javascript/manga/src/all/mangafire.js index eccabd8f..07dc4af1 100644 --- a/javascript/manga/src/all/mangafire.js +++ b/javascript/manga/src/all/mangafire.js @@ -5,7 +5,7 @@ const mangayomiSources = [{ "apiUrl": "", "iconUrl": "https://mangafire.to/assets/sites/mangafire/favicon.png?v3", "typeSource": "single", - "isManga": true, + "itemType": 0, "version": "0.1.21", "dateFormat": "", "dateFormatLocale": "", diff --git a/javascript/manga/src/en/asurascans.js b/javascript/manga/src/en/asurascans.js index a2208237..48457a08 100644 --- a/javascript/manga/src/en/asurascans.js +++ b/javascript/manga/src/en/asurascans.js @@ -6,7 +6,7 @@ const mangayomiSources = [{ "apiUrl": "", "iconUrl": "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/javascript/icon/en.asurascans.png", "typeSource": "single", - "isManga": true, + "itemType": 0, "version": "0.1.7", "dateFormat": "", "dateFormatLocale": "", diff --git a/javascript/manga/src/zh/77mh.js b/javascript/manga/src/zh/77mh.js index 14c31c12..5ec512d8 100644 --- a/javascript/manga/src/zh/77mh.js +++ b/javascript/manga/src/zh/77mh.js @@ -5,7 +5,7 @@ const mangayomiSources = [{ "apiUrl": "", "iconUrl": "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/javascript/icon/zh.77mh.png", "typeSource": "single", - "isManga": true, + "itemType": 0, "isNsfw": false, "version": "0.0.25", "apiUrl": "", diff --git a/javascript/manga/src/zh/copymanga.js b/javascript/manga/src/zh/copymanga.js index c100ba9b..ae63eae6 100644 --- a/javascript/manga/src/zh/copymanga.js +++ b/javascript/manga/src/zh/copymanga.js @@ -5,7 +5,7 @@ const mangayomiSources = [{ "apiUrl": "https://api.mangacopy.com", "iconUrl": "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/javascript/icon/zh.copymanga.png", "typeSource": "single", - "isManga": true, + "itemType": 0, "isNsfw": false, "version": "0.0.25", "dateFormat": "", diff --git a/javascript/manga/src/zh/dmzj.js b/javascript/manga/src/zh/dmzj.js index d8ebf4af..c2019a3a 100644 --- a/javascript/manga/src/zh/dmzj.js +++ b/javascript/manga/src/zh/dmzj.js @@ -5,7 +5,7 @@ const mangayomiSources = [{ "apiUrl": "", "iconUrl": "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/javascript/icon/zh.dmzj.png", "typeSource": "single", - "isManga": true, + "itemType": 0, "isNsfw": false, "version": "0.0.3", "dateFormat": "", diff --git a/javascript/novel/src/en/novelupdates.js b/javascript/novel/src/en/novelupdates.js new file mode 100644 index 00000000..fb555f9a --- /dev/null +++ b/javascript/novel/src/en/novelupdates.js @@ -0,0 +1,816 @@ +const mangayomiSources = [{ + "name": "Novel Updates", + "lang": "en", + "baseUrl": "https://www.novelupdates.com", + "apiUrl": "", + "iconUrl": + "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/javascript/icon/en.novelupdates.png", + "typeSource": "single", + "itemType": 2, + "version": "0.0.2", + "dateFormat": "", + "dateFormatLocale": "", + "pkgPath": "novel/src/en/novelupdates.js", + "appMinVerReq": "0.4.0", + "isNsfw": false, + "hasCloudflare": true +}]; + +class DefaultExtension extends MProvider { + headers = { + Referer: this.source.baseUrl, + Origin: this.source.baseUrl, + Connection: "keep-alive", + Accept: "*/*", + "Accept-Language": "*", + "Sec-Fetch-Mode": "cors", + "Accept-Encoding": "gzip, deflate", + "User-Agent": + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36", + }; + + getHeaders(url) { + throw new Error("getHeaders not implemented"); + } + + mangaListFromPage(res) { + const doc = new Document(res.body); + const mangaElements = doc.select("div.search_main_box_nu"); + const list = []; + for (const element of mangaElements) { + const name = element.selectFirst(".search_title > a").text; + const imageUrl = element.selectFirst("img").getSrc; + const link = element.selectFirst(".search_title > a").getHref; + list.push({ name, imageUrl, link }); + } + const hasNextPage = + doc.selectFirst("div.digg_pagination > a.next_page").text == " →"; + return { list: list, hasNextPage }; + } + + toStatus(status) { + if (status.includes("Ongoing")) return 0; + else if (status.includes("Completed")) return 1; + else if (status.includes("Hiatus")) return 2; + else if (status.includes("Dropped")) return 3; + else return 5; + } + + async getPopular(page) { + const res = await new Client().get( + `${this.source.baseUrl}/series-ranking/?rank=popmonth&pg=${page}`, + this.headers + ); + return this.mangaListFromPage(res); + } + + async getLatestUpdates(page) { + const res = await new Client().get( + `${this.source.baseUrl}/series-finder/?sf=1&sh=&sort=sdate&order=desc&pg=${page}`, + this.headers + ); + return this.mangaListFromPage(res); + } + + async search(query, page, filters) { + let url = `${this.source.baseUrl}/series-finder/?sf=1&sh=${query}&pg=${page}`; + + if (!filters || filters.length == 0) { + const res = await new Client().get(url, this.headers); + return this.mangaListFromPage(res); + } + + if (filters[0].state.filter(f => f.state == true).length > 0) { + const values = filters[0].state.filter(f => f.state == true).map(f => f.value).join(","); + url += `&nt=${values}`; + } + + if (filters[1].state.filter(f => f.state == true).length > 0) { + const values = filters[1].state.filter(f => f.state == true).map(f => f.value).join(","); + url += `&org=${values}`; + } + + if (filters[2].state.filter(f => f.state == 1 || f.state == 2).length > 0) { + const including = filters[2].state.filter(f => f.state == 1).map(f => f.value).join(","); + const excluding = filters[2].state.filter(f => f.state == 2).map(f => f.value).join(","); + if (including.length > 0) url += `&gi=${including}`; + if (excluding.length > 0) url += `&ge=${excluding}`; + } + + if (filters[3].state.filter(f => f.state == true).length > 0) { + const values = filters[3].state.filter(f => f.state == true).map(f => f.value).join(","); + url += `&ss=${values}`; + } + + url += `&sort=${filters[4].values[filters[4].state].value}`; + url += `&order=${filters[5].values[filters[5].state].value}`; + + const res = await new Client().get(url, this.headers); + return this.mangaListFromPage(res); + } + + async getDetail(url) { + const client = new Client(); + const res = await client.get(url, this.headers); + const doc = new Document(res.body); + const imageUrl = doc.selectFirst(".wpb_wrapper img")?.getSrc; + const type = doc.selectFirst("#showtype")?.text.trim(); + const description = + doc.selectFirst("#editdescription")?.text.trim() + `\n\nType: ${type}`; + const author = doc + .select("#authtag") + .map((el) => el.text.trim()) + .join(", "); + const artist = doc + .select("#artiststag") + .map((el) => el.text.trim()) + .join(", "); + const status = this.toStatus(doc.selectFirst("#editstatus").text.trim()); + const genre = doc.select("#seriesgenre > a").map((el) => el.text.trim()); + + const novelId = doc.selectFirst("input#mypostid")?.attr("value"); + + const link = `https://www.novelupdates.com/wp-admin/admin-ajax.php`; + const headers = { + "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8", + ...this.headers, + }; + + const chapters = []; + const chapterRes = await client.post(link, headers, { + action: "nd_getchapters", + mygrr: "0", + mypostid: novelId, + }); + const chapterDoc = new Document(chapterRes.body); + + const nameReplacements = { + v: "Volume ", + c: " Chapter ", + part: "Part ", + ss: "SS", + }; + + const chapterElements = chapterDoc.select("li.sp_li_chp"); + for (const el of chapterElements) { + let chapterName = el.selectFirst("span").text; + for (const name in nameReplacements) { + chapterName = chapterName.replace(name, nameReplacements[name]); + } + chapterName = chapterName.replace(/\b\w/g, (l) => l.toUpperCase()).trim(); + const chapterUrl = `https:${el.select("a")[1].getHref}`; + const dateUpload = String(Date.now()); + chapters.push({ + name: chapterName, + url: chapterUrl, + dateUpload: dateUpload, + scanlator: null, + }); + } + + chapters.reverse(); + + return { + imageUrl, + description, + genre, + author, + artist, + status, + chapters, + }; + } + + async getHtmlContent(url) { + const client = await new Client(); + const res = await client.get(url, { + Priority: "u=0, i", + "User-Agent": + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36", + }); + const doc = new Document(res.body); + const domain = res.body; + + if (domain.includes("anotivereads")) { + const title = + doc.selectFirst("#comic-nav-name")?.text.trim() || + ""; + const content = doc.selectFirst("#spliced-comic")?.innerHtml; + return `

${title}



${content}`; + } + + if (domain.includes("asuratls")) { + const title = + doc.selectFirst(".post-body > div > b")?.text.trim() || + ""; + const content = doc.selectFirst(".post-body")?.innerHtml?.replace(title, ""); + return `

${title}



${content}`; + } + + if (domain.includes("daoist")) { + const title = + doc.selectFirst(".chapter__title")?.text.trim() || + ""; + const content = doc.selectFirst(".chapter__content")?.innerHtml; + return `

${title}



${content}`; + } + + if (domain.includes("darkstartranslations")) { + const title = + doc.selectFirst("ol.breadcrumb > li")?.text.trim() || + ""; + const content = doc.selectFirst(".text-left")?.innerHtml?.replace("
", "

"); + return `

${title}



${content}`; + } + + if (domain.includes("fictionread")) { + const title = + doc.selectFirst(".title-image > span")?.text.trim() || + ""; + const content = doc.selectFirst(".content")?.innerHtml; + return `

${title}



${content}`; + } + + if (domain.includes("helscans")) { + const title = + doc.selectFirst(".entry-title-main")?.text.trim() || + ""; + const content = doc.selectFirst("#readerarea.rdminimal")?.innerHtml; + return `

${title}



${content}`; + } + + if (domain.includes("hiraethtranslation")) { + const title = + doc.selectFirst("li.active")?.text.trim() || + ""; + const content = doc.selectFirst(".text-left")?.innerHtml; + return `

${title}



${content}`; + } + + if (domain.includes("hostednovel")) { + const title = + doc.selectFirst("#chapter-title")?.text.trim() || + ""; + const content = doc.selectFirst("#chapter-content")?.innerHtml; + return `

${title}



${content}`; + } + + if (domain.includes("inoveltranslation")) { + const content = doc.selectFirst(".styles_content__JHK8G")?.innerHtml; + return `${content}`; + } + + if (domain.includes("isotls")) { + const title = + doc.selectFirst("head > title")?.text.trim() || + ""; + const content = doc.selectFirst("main > article")?.innerHtml; + return `

${title}



${content}`; + } + + if (domain.includes("mirilu")) { + const title = + doc.selectFirst(".entry-content > p > strong")?.text.trim() || + ""; + const content = doc.selectFirst(".entry-content")?.innerHtml; + return `

${title}



${content}`; + } + + if (domain.includes("novelplex")) { + const title = + doc.selectFirst(".halChap--jud")?.text.trim() || + ""; + const content = doc.selectFirst(".halChap--kontenInner")?.innerHtml; + return `

${title}



${content}`; + } + + if (domain.includes("novelworldtranslations")) { + const title = + doc.selectFirst(".entry-title")?.text.trim() || + ""; + const content = doc.selectFirst(".entry-content")?.innerHtml?.replace(/ /g, '')?.replace(/\n/g, '
'); + return `

${title}



${content}`; + } + + if (domain.includes("readingpia")) { + const content = doc.selectFirst(".chapter-body")?.innerHtml; + return `${content}`; + } + + if (domain.includes("sacredtexttranslations")) { + const title = + doc.selectFirst(".entry-title")?.text.trim() || + ""; + const content = doc.selectFirst(".entry-content")?.innerHtml; + return `

${title}



${content}`; + } + + if (domain.includes("scribblehub")) { + const title = + doc.selectFirst(".chapter-title")?.text.trim() || + ""; + const content = doc.selectFirst(".chp_raw")?.innerHtml; + return `

${title}



${content}`; + } + + if (domain.includes("tinytranslation")) { + const title = + doc.selectFirst(".title-content")?.text.trim() || + ""; + const content = doc.selectFirst(".content")?.innerHtml; + return `

${title}



${content}`; + } + + if (domain.includes("tumblr")) { + const content = doc.selectFirst(".post")?.innerHtml; + return `${content}`; + } + + if (domain.includes("wattpad")) { + const title = + doc.selectFirst(".h2")?.text.trim() || + ""; + const content = doc.selectFirst(".part-content > pre")?.innerHtml; + return `

${title}



${content}`; + } + + if (domain.includes("webnovel")) { + const title = + doc.selectFirst(".cha-tit > .pr > .dib")?.text.trim() || + ""; + const content = doc.selectFirst(".cha-words")?.innerHtml || doc.selectFirst("._content")?.innerHtml; + return `

${title}



${content}`; + } + + if (domain.includes("wetriedtls")) { + const content = doc.selectFirst("script:contains(\"p dir=\")")?.innerHtml || doc.selectFirst("script:contains(\"u003c\")")?.innerHtml; + if (content) { + const jsonString_wetried = content.slice( + content.indexOf('.push(') + '.push('.length, + content.lastIndexOf(')'), + ); + return `${JSON.parse(jsonString_wetried)[1]}`; + } + return "

Failed to parse JSON content!

"; + } + + if (domain.includes("wuxiaworld")) { + const title = + doc.selectFirst("h4 > span")?.text.trim() || + ""; + const content = doc.selectFirst(".chapter-content")?.innerHtml; + return `

${title}



${content}`; + } + + if (domain.includes("zetrotranslation")) { + const title = + doc.selectFirst(".text-left h2")?.text.trim() || + doc.selectFirst(".active")?.text.trim() || + ""; + const content = doc.selectFirst(".text-left")?.innerHtml; + return `

${title}



${content}`; + } + + if (domain.includes("webnovel")) { + const title = + doc.selectFirst("#page > .chapter_content > .cha-tit > div > div")?.text.trim() || + ""; + const content = doc.selectFirst("#page > .chapter_content > .cha-content > .cha-words")?.innerHtml.replaceAll(/.*?<\/i>/gm, ""); + return `

${title}



${content}`; + } + + if (domain.includes("re-library")) { + const redirectUrl = doc.selectFirst(".entry-content > div > div > p > a").getHref; + const redirectRes = await client.get(redirectUrl, { + Priority: "u=0, i", + "User-Agent": + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36", + }); + const redirectDoc = new Document(redirectRes.body); + const title = + redirectDoc.selectFirst(".entry-header > .entry-title")?.text.trim() || + ""; + const content = redirectDoc.selectFirst(".entry-content")?.innerHtml.replaceAll(/.*?<\/i>/gm, ""); + return `

${title}



${content}`; + } + + const blogspotElements = [ + doc.selectFirst("meta[name=\"google-adsense-platform-domain\"]").attr("content"), + doc.selectFirst("meta[name=\"generator\"]").attr("content"), + ]; + const isBlogspot = blogspotElements.some(e => { + return e?.toLowerCase().includes("blogspot") || e?.toLowerCase().includes("blogger") + }); + + if (isBlogspot) { + const title = + doc.selectFirst("h3.post-title")?.text.trim() || + doc.selectFirst("h3.entry-title")?.text.trim() || + ""; + const content = + doc.selectFirst("div.post-body")?.innerHtml || + doc.selectFirst("div.entry-content")?.innerHtml || + doc.selectFirst("div.content-post")?.innerHtml; + return `

${title}



${content}`; + } + + const wordpressElements = [ + doc.selectFirst("#dcl_comments-js-extra")?.innerHtml, + doc.selectFirst("meta[name=\"generator\"]")?.attr("content"), + doc.selectFirst(".powered-by")?.text, + doc.selectFirst("footer")?.text, + ]; + let isWordpress = wordpressElements.some(e => { + return e?.toLowerCase().includes("wordpress") || e?.toLowerCase().includes("site kit by google") + }); + + + let title = + doc.selectFirst(".entry-title")?.text.trim() || + doc.selectFirst(".entry-title-main")?.text.trim() || + doc.selectFirst(".chapter__title")?.text.trim() || + doc.selectFirst(".sp-title")?.text.trim() || + doc.selectFirst(".title-content")?.text.trim() || + doc.selectFirst(".wp-block-post-title")?.text.trim() || + doc.selectFirst(".title_story")?.text.trim() || + doc.selectFirst(".active")?.text.trim() || + doc.selectFirst("head title")?.text.trim() || + doc.selectFirst("h1.leading-none ~ h2")?.text.trim() || + ""; + const subtitle = + doc.selectFirst(".cat-series")?.text.trim() || + doc.selectFirst("h1.leading-none ~ span")?.text.trim() || + ""; + if (subtitle && subtitle != "") { + title = subtitle; + } + const content = + doc.selectFirst(".rdminimal")?.innerHtml || + doc.selectFirst(".entry-content")?.innerHtml || + doc.selectFirst(".chapter__content")?.innerHtml || + doc.selectFirst(".prevent-select")?.innerHtml || + doc.selectFirst(".text_story")?.innerHtml || + doc.selectFirst(".contenta")?.innerHtml || + doc.selectFirst(".single_post")?.innerHtml || + doc.selectFirst(".post-entry")?.innerHtml || + doc.selectFirst(".main-content")?.innerHtml || + doc.selectFirst(".post-content")?.innerHtml || + doc.selectFirst(".content")?.innerHtml || + doc.selectFirst(".page-body")?.innerHtml || + doc.selectFirst(".td-page-content")?.innerHtml || + doc.selectFirst(".reader-content")?.innerHtml || + doc.selectFirst("#content")?.innerHtml || + doc.selectFirst("#the-content")?.innerHtml || + doc.selectFirst("article.post")?.innerHtml; + + if (isWordpress || domain.includes("etherreads") || domain.includes("soafp")) { + return `

${title}



${content}`; + } + + return `

Domain not supported yet. Content might not load properly!

+

${title}



${content}`; + } + + getFilterList() { + return [ + { + type_name: "GroupFilter", + name: "Novel Type", + state: [ + { + type_name: "CheckBox", + name: "Web Novel", + value: "2444", + }, + { + type_name: "CheckBox", + name: "Light Novel", + value: "2443", + }, + { + type_name: "CheckBox", + name: "Published Novel", + value: "26874", + }, + ], + }, + { + type_name: "GroupFilter", + name: "Original Language", + state: [ + { + type_name: "CheckBox", + name: "Chinese", + value: "495", + }, + { + type_name: "CheckBox", + name: "Filipino", + value: "9181", + }, + { + type_name: "CheckBox", + name: "Indonesian", + value: "9179", + }, + { + type_name: "CheckBox", + name: "Japanese", + value: "496", + }, + { + type_name: "CheckBox", + name: "Khmer", + value: "18657", + }, + { + type_name: "CheckBox", + name: "Korean", + value: "497", + }, + { + type_name: "CheckBox", + name: "Malaysian", + value: "9183", + }, + { + type_name: "CheckBox", + name: "Thai", + value: "9954", + }, + { + type_name: "CheckBox", + name: "Vietnamese", + value: "9177", + }, + ], + }, + { + type_name: "GroupFilter", + name: "Genre", + state: [ + { + type_name: "TriState", + name: "Action", + value: "8", + }, + { + type_name: "TriState", + name: "Adventure", + value: "13", + }, + { + type_name: "TriState", + name: "Comedy", + value: "17", + }, + { + type_name: "TriState", + name: "Drama", + value: "9", + }, + { + type_name: "TriState", + name: "Ecchi", + value: "292", + }, + { + type_name: "TriState", + name: "Fantasy", + value: "5", + }, + { + type_name: "TriState", + name: "Gender Bender", + value: "168", + }, + { + type_name: "TriState", + name: "Harem", + value: "3", + }, + { + type_name: "TriState", + name: "Horror", + value: "343", + }, + { + type_name: "TriState", + name: "Josei", + value: "324", + }, + { + type_name: "TriState", + name: "Martial Arts", + value: "14", + }, + { + type_name: "TriState", + name: "Mature", + value: "4", + }, + { + type_name: "TriState", + name: "Mecha", + value: "10", + }, + { + type_name: "TriState", + name: "Mystery", + value: "245", + }, + { + type_name: "TriState", + name: "Psychological", + value: "486", + }, + { + type_name: "TriState", + name: "Romance", + value: "15", + }, + { + type_name: "TriState", + name: "School", + value: "6", + }, + { + type_name: "TriState", + name: "Sci-Fi", + value: "11", + }, + { + type_name: "TriState", + name: "Seinen", + value: "18", + }, + { + type_name: "TriState", + name: "Shoujo", + value: "157", + }, + { + type_name: "TriState", + name: "Shoujo Ai", + value: "851", + }, + { + type_name: "TriState", + name: "Shounen", + value: "12", + }, + { + type_name: "TriState", + name: "Shounen Ai", + value: "1692", + }, + { + type_name: "TriState", + name: "Slice of Life", + value: "7", + }, + { + type_name: "TriState", + name: "Smut", + value: "281", + }, + { + type_name: "TriState", + name: "Sports", + value: "1357", + }, + { + type_name: "TriState", + name: "Supernatural", + value: "16", + }, + { + type_name: "TriState", + name: "Tragedy", + value: "132", + }, + { + type_name: "TriState", + name: "Wuxia", + value: "479", + }, + { + type_name: "TriState", + name: "Xianxia", + value: "480", + }, + { + type_name: "TriState", + name: "Xuanhuan", + value: "3954", + }, + { + type_name: "TriState", + name: "Yaoi", + value: "560", + }, + { + type_name: "TriState", + name: "Yuri", + value: "922", + }, + ], + }, + { + type_name: "GroupFilter", + name: "Status", + state: [ + { + type_name: "CheckBox", + name: "All", + value: "", + }, + { + type_name: "CheckBox", + name: "Completed", + value: "2", + }, + { + type_name: "CheckBox", + name: "Ongoing", + value: "3", + }, + { + type_name: "CheckBox", + name: "Hiatus", + value: "4", + }, + ], + }, + { + type_name: "SelectFilter", + type: "sort", + name: "Sort", + state: 0, + values: [ + { + type_name: "SelectOption", + name: "Last Updated", + value: "sdate", + }, + { + type_name: "SelectOption", + name: "Rating", + value: "srate", + }, + { + type_name: "SelectOption", + name: "Rank", + value: "srank", + }, + { + type_name: "SelectOption", + name: "Reviews", + value: "sreview", + }, + { + type_name: "SelectOption", + name: "Chapters", + value: "srel", + }, + { + type_name: "SelectOption", + name: "Title", + value: "abc", + }, + { + type_name: "SelectOption", + name: "Readers", + value: "sread", + }, + { + type_name: "SelectOption", + name: "Frequency", + value: "sfrel", + }, + ], + }, + { + type_name: "SelectFilter", + name: "Order", + state: 0, + values: [ + { + type_name: "SelectOption", + name: "Descending", + value: "desc", + }, + { + type_name: "SelectOption", + name: "Ascending", + value: "asc", + }, + ], + } + ]; + } + + getSourcePreferences() { + throw new Error("getSourcePreferences not implemented"); + } +} diff --git a/model/source.dart b/model/source.dart index a1bf987c..f9bc6993 100644 --- a/model/source.dart +++ b/model/source.dart @@ -27,6 +27,8 @@ class Source { bool? isManga; + ItemType? itemType; + bool? isFullData; String? appMinVerReq; @@ -49,7 +51,8 @@ class Source { this.sourceCodeUrl = "", this.apiUrl = "", this.version = "", - this.isManga = true, + this.isManga, + this.itemType = ItemType.manga, this.isFullData = false, this.appMinVerReq = "0.2.0", this.additionalParams = "", @@ -69,10 +72,11 @@ class Source { : 'mangayomi-js-"${json['lang'] ?? ""}"."${json['name'] ?? ""}"')) .hashCode; isFullData = json['isFullData'] ?? false; - isManga = json['isManga'] ?? false; + itemType = ItemType.values[json['itemType'] ?? 0]; isNsfw = json['isNsfw'] ?? false; lang = json['lang'] ?? ""; name = json['name'] ?? ""; + isManga = json['isManga'] ?? ((json['itemType'] as int?) ?? 0) == 0; sourceCodeUrl = json['sourceCodeUrl'] ?? ""; typeSource = json['typeSource'] ?? ""; version = json['version'] ?? ""; @@ -95,7 +99,8 @@ class Source { "sourceCodeUrl": sourceCodeUrl, "apiUrl": apiUrl, "version": version, - "isManga": isManga, + "isManga": isManga ?? (itemType?.index ?? 0) == 0, + "itemType": itemType?.index ?? 0, "isFullData": isFullData, "appMinVerReq": appMinVerReq, "additionalParams": additionalParams, @@ -105,3 +110,5 @@ class Source { } const branchName = "main"; + +enum ItemType { manga, anime, novel } diff --git a/source_generator.dart b/source_generator.dart index 25051b2a..354e8056 100644 --- a/source_generator.dart +++ b/source_generator.dart @@ -3,12 +3,14 @@ import 'dart:developer'; import 'dart:io'; import 'dart/anime/anime_source_list.dart'; import 'dart/manga/manga_source_list.dart'; +import 'dart/novel/novel_source_list.dart'; import 'model/source.dart'; void main() { final jsSources = _searchJsSources(Directory("javascript")); - genManga(jsSources.where((element) => element.isManga!).toList()); - genAnime(jsSources.where((element) => !element.isManga!).toList()); + genManga(jsSources.where((element) => element.itemType!.name == "manga").toList()); + genAnime(jsSources.where((element) => element.itemType!.name == "anime").toList()); + genNovel(jsSources.where((element) => element.itemType!.name == "novel").toList()); } void genManga(List jsMangasourceList) { @@ -39,6 +41,20 @@ void genAnime(List jsAnimesourceList) { log('JSON file created: ${file.path}'); } +void genNovel(List jsNovelSourceList) { + List novelSources = []; + novelSources.addAll(dartNovelSourceList); + novelSources.addAll(jsNovelSourceList); + final List> jsonList = + novelSources.map((source) => source.toJson()).toList(); + final jsonString = jsonEncode(jsonList); + + final file = File('novel_index.json'); + file.writeAsStringSync(jsonString); + + log('JSON file created: ${file.path}'); +} + List _searchJsSources(Directory dir) { List sourceList = []; List entities = dir.listSync();