diff --git a/src/all/mmrcms/build.gradle b/src/all/mmrcms/build.gradle index c27a6bd37..0717ab9d6 100644 --- a/src/all/mmrcms/build.gradle +++ b/src/all/mmrcms/build.gradle @@ -5,8 +5,8 @@ ext { appName = 'Tachiyomi: My Manga Reader CMS (Many sources)' pkgNameSuffix = 'all.mmrcms' extClass = '.MyMangaReaderCMSSources' - extVersionCode = 10 - extVersionSuffix = 10 + extVersionCode = 11 + extVersionSuffix = 11 libVersion = '1.2' } diff --git a/src/all/mmrcms/genSources.sh b/src/all/mmrcms/genSources.sh deleted file mode 100755 index a2b641dad..000000000 --- a/src/all/mmrcms/genSources.sh +++ /dev/null @@ -1,367 +0,0 @@ -#!/usr/bin/env bash -echo "My Manga Reader CMS source generator by: nulldev" -# CMS: https://getcyberworks.com/product/manga-reader-cms/ - -# Print a message out to stderr -function echoErr() { - echo "ERROR: $@" >&2 -} - -# Require that a command exists before continuing -function require() { - command -v $1 >/dev/null 2>&1 || { echoErr "This script requires $1 but it's not installed."; exit 1; } -} - -# Define commands that this script depends on -require xmllint -require jq -require perl -require wget -require curl -require grep -require sed - -# Show help/usage info -function printHelp() { - echo "Usage: ./genSources.sh [options]" - echo "" - echo "Options:" - echo "--help: Show this help page" - echo "--dry-run: Perform a dry run (make no changes)" - echo "--list: List currently available sources" - echo "--out : Explicitly specify output file" -} -# Target file -TARGET="src/eu/kanade/tachiyomi/extension/all/mmrcms/GeneratedSources.kt" -# String containing processed URLs (used to detect duplicate URLs) -PROCESSED="" - -# Parse CLI args -while [ $# -gt 0 ] -do - case "$1" in - --help) - printHelp - exit 0 - ;; - --dry-run) OPT_DRY_RUN=true - ;; - --list) - OPT_DRY_RUN=true - OPT_LIST=true - ;; - --out) - TARGET="$2" - shift - ;; - --*) - echo "Invalid option $1!" - printHelp - exit -1 - ;; - *) - echo "Invalid argument $1!" - printHelp - exit -1 - ;; - esac - shift -done - -# Change target if performing dry run -if [ "$OPT_DRY_RUN" = true ] ; then - # Do not warn if dry running because of list - if ! [ "$OPT_LIST" = true ] ; then - echo "Performing a dry run, no changes will be made!" - fi - TARGET="/dev/null" -else - # Delete old sources - rm "$TARGET" -fi - -# Variable used to store output while processing -QUEUED_SOURCES="[" - -# lang, name, baseUrl -function gen() { - PROCESSED="$PROCESSED$3\n" - if [ "$OPT_LIST" = true ] ; then - echo "- $(echo "$1" | awk '{print toupper($0)}'): $2" - else - echo "Generating source: $2" - QUEUED_SOURCES="$QUEUED_SOURCES"$'\n'"$(genSource "$1" "$2" "$3")" - # genSource runs in a subprocess, so we check for bad exit code and exit current process if necessary - [ $? -ne 0 ] && exit -1; - fi -} - -# Find and get the item URL from an HTML page -function getItemUrl() { - grep -oP "(?<=showURL = \")(.*)(?=SELECTION)" "$1" -} - -# Strip all scripts and Cloudflare email protection from page -# We strip Cloudflare email protection as titles like 'IDOLM@STER' can trigger it and break the parser -function stripScripts() { - perl -0pe 's/[\s\S]*?< *?\/ *?script *?>//g' |\ - perl -0pe 's/[\s\S]*?< *?\/ *?span *?>/???@???/g' -} - -# Verify that a response is valid -function verifyResponse() { - [ "${1##*$'\n'}" -eq "200" ] && [[ "$1" != *"Whoops, looks like something went wrong"* ]] -} - -# Get the available tags from the manga list page -function parseTagsFromMangaList() { - xmllint --xpath "//div[contains(@class, 'tag-links')]//a" --html "$1" 2>/dev/null |\ - sed 's/<\/a>/"},\n/g; s/">/", "name": "/g;' |\ - perl -pe 's//dev/null |\ - sed 's/<\/a>/"},\n/g; s/" class="category">/", "name": "/g;' |\ - perl -pe 's//dev/null |\ - sed 's/<\/option>/"},\n/g; s/