MangaHub: fix random user agent (#14710)

* MangaHub: fix random user agent

* update comment

* REMOVED_SOURCES.md
This commit is contained in:
mobi2002 2022-12-29 01:33:04 +05:00 committed by GitHub
parent 181e3c0f07
commit 95fa2facb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 6 deletions

View File

@ -37,7 +37,7 @@ jobs:
},
{
"type": "both",
"regex": ".*(mangago|mangafox|hq\\s*dragon|manga\\s*host|supermangas|superhentais|union\\s*mangas|yes\\s*mangas|manhuascan|manhwahot|leitor\\.?net|manga\\s*livre|tsuki\\s*mangas|manga\\s*yabu|mangas\\.in|mangas\\.pw|hentaikai|toptoon\\+?|cocomanga|hitomi\\.la|copymanga|neox|1manga\\.co|mangafox\\.fun|mangahere\\.onl|manga\\s*hub|mangakakalot\\.fun|manganel(?!o)|mangaonline\\.fun|mangapanda\\.onl|mangareader\\.site|mangatoday|manga\\.town|onemanga\\.info|koushoku).*",
"regex": ".*(mangago|mangafox|hq\\s*dragon|manga\\s*host|supermangas|superhentais|union\\s*mangas|yes\\s*mangas|manhuascan|manhwahot|leitor\\.?net|manga\\s*livre|tsuki\\s*mangas|manga\\s*yabu|mangas\\.in|mangas\\.pw|hentaikai|toptoon\\+?|cocomanga|hitomi\\.la|copymanga|neox|1manga\\.co|mangafox\\.fun|mangahere\\.onl|mangakakalot\\.fun|manganel(?!o)|mangaonline\\.fun|mangatoday|manga\\.town|onemanga\\.info|koushoku).*",
"ignoreCase": true,
"message": "{match} will not be added back as it is too difficult to maintain. Read #3475 for more information."
},

View File

@ -11,7 +11,6 @@
- Mangá Host https://github.com/tachiyomiorg/tachiyomi-extensions/pull/7065
- Mangá Livre and Leitor.net https://github.com/tachiyomiorg/tachiyomi-extensions/pull/8679
- mangago.me https://github.com/tachiyomiorg/tachiyomi-extensions/issues/988
- MangaHub https://github.com/tachiyomiorg/tachiyomi-extensions/pull/13174
- MangaYabu! https://github.com/tachiyomiorg/tachiyomi-extensions/pull/9336
- ManhuaScan https://github.com/tachiyomiorg/tachiyomi-extensions/pull/7129
- ManhwaHot https://github.com/tachiyomiorg/tachiyomi-extensions/pull/7129

View File

@ -61,9 +61,9 @@ abstract class MangaHub(
val uaResponse = chain.proceed(GET(UA_DB_URL))
if (uaResponse.isSuccessful) {
// only using chrome, apparently they refuse to load(403) if not chrome
val chromeUserAgentString = json.decodeFromString<List<String>>(uaResponse.body!!.string())
.filter { it.contains("chrome", ignoreCase = true) }
// only using desktop chromium-based browsers, apparently they refuse to load(403) if not chrome(ium)
val uaList = json.decodeFromString<Map<String, List<String>>>(uaResponse.body!!.string())
val chromeUserAgentString = uaList["desktop"]!!.filter { it.contains("chrome", ignoreCase = true) }
userAgent = chromeUserAgentString.random()
checkedUa = true
}

View File

@ -9,7 +9,7 @@ class MangaHubGenerator : ThemeSourceGenerator {
override val themeClass = "MangaHub"
override val baseVersionCode: Int = 11
override val baseVersionCode: Int = 12
override val sources = listOf(
// SingleLang("1Manga.co", "https://1manga.co", "en", isNsfw = true, className = "OneMangaCo"),