From d7439b73e9397d83552ac46479c3db51ed9f8593 Mon Sep 17 00:00:00 2001 From: Pavka Date: Tue, 1 Sep 2020 10:04:46 +0300 Subject: [PATCH] [Ru] New source. Yaoi-chan.me (#4260) * [ru] libmanga fix 18+ mangas w/o authorization * Yaoichan. pageNum refactor * Yaoichan. Some refactoring Co-authored-by: pavkazzz --- src/ru/yaoichan/build.gradle | 17 ++ .../yaoichan/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 1593 bytes .../yaoichan/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 884 bytes .../yaoichan/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 1910 bytes .../res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 3460 bytes .../res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 4286 bytes src/ru/yaoichan/res/web_hi_res_512.png | Bin 0 -> 13398 bytes .../extension/ru/yaoichan/Yaoichan.kt | 269 ++++++++++++++++++ 8 files changed, 286 insertions(+) create mode 100644 src/ru/yaoichan/build.gradle create mode 100644 src/ru/yaoichan/res/mipmap-hdpi/ic_launcher.png create mode 100644 src/ru/yaoichan/res/mipmap-mdpi/ic_launcher.png create mode 100644 src/ru/yaoichan/res/mipmap-xhdpi/ic_launcher.png create mode 100644 src/ru/yaoichan/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 src/ru/yaoichan/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 src/ru/yaoichan/res/web_hi_res_512.png create mode 100644 src/ru/yaoichan/src/eu/kanade/tachiyomi/extension/ru/yaoichan/Yaoichan.kt diff --git a/src/ru/yaoichan/build.gradle b/src/ru/yaoichan/build.gradle new file mode 100644 index 000000000..d1ea2dde3 --- /dev/null +++ b/src/ru/yaoichan/build.gradle @@ -0,0 +1,17 @@ +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' + +ext { + extName = 'Yaoichan' + pkgNameSuffix = 'ru.yaoichan' + extClass = '.Yaoichan' + extVersionCode = 1 + libVersion = '1.2' + containsNsfw = true +} + +dependencies { + implementation project(':lib-ratelimit') +} + +apply from: "$rootDir/common.gradle" diff --git a/src/ru/yaoichan/res/mipmap-hdpi/ic_launcher.png b/src/ru/yaoichan/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..84c832102c57568b74059ab237325d40b408d743 GIT binary patch literal 1593 zcmV-92FCe`P)Med6=6jO zI(1`%`DLBjE?N;bhM+KXYei?~%5rj&rb%--NzUc{`{6x@q{&HhX-;#poj?3(KQuk( z`SCo@dpjpYjvP619cck0}G!{P9w zLqkK|)d1CS`t<3QilPiL#-;!$sDCK{rc_n+oH})CIq|HjEOYkl+qWo{N}Z{7L{>?b z<+B3=14}E-q^7G^ukO$^ZK~FRSS3x`<-MV`xd3KeWRePd^;mii8SpcR>yT<$g zVgR0r0E=gVV|axKycaJG&`}BKr~uH$08nC;&2N)VFyKsz!&(~vx^v)kW%<)Y@ujZ@ zU_t|amw}(sz~kWzBm<0F1h$8O12NwB{#1Zu>3y#@qnHBV$29Ojs4$?_0l<^u*;k5W z0Ix=80&@F-_v1jY^roDv+70szfL8_X3FgD;)PL>_15+gicU=SSo6Nvz_486q&ta5= z9p*u!X<)fH6OQ3-KQEn9bT~1y_dGmR)^J`(wFeYqz;hAausd_y;RhZJ6>q3M4Okb* zz*#B+$E4EBbGCn7b3g#kqSb+XI34=$Cz7*&es6SU_G}LU(JIh^T>z;7o{r?hF}x*M zc;0eJ0oDaGa60_J52>o$7GM`Z01tGfm=CAj58Nv9WlAn1nF0G_ymuMH`p$59v+*Lb z4_ddVVX}y zt0;Q`N-^NIC@-08IL0#Kp-^U>HlYG*0-5Z&J;0lNm1QqL0Pw5K1J8xirkCAuiT~Zp z(V1(lry_Hn6q?C?fB;}uBp;5kgxEUCmnqrVvseVitvOt=C!lc!xJ@))r7sqFWA4bx zo;PEb+y-D*KmhPc)O-sgcN^p0Am2f>NcIKvw+h@5m>o`=o;?;GUD_8=oB_{H7v4f` z@$==$MQaas?F$G1zD@F8WCo|%4?I6z)mgKd>DyLe6eb=>H|=-2^ zK)P}PHD%d??TuX78<5O^jlp~{hC_2d_bMiP0~%BKzKiIaz}*4hY#NXlpjcCG_5w7T2G)p$ORCYt4Z2$d;KgZvQd>pY3()RJ`CtsY z1pe@XP~E;{FF^0cDu?3|fWFY29(6I3y#PfR@KKx}Abt=71`@zv0{B7#zL9|AN#IzL zKUwy<#2>QyFb=#G=_>=x(aug*q1zwQk$CZQYeCSAMB= zAXdri^`7tV@83W~ZRG-5Ktv0PXh~mR-`2~QFQ1FY<55|bHAPWS&z5CblO!oNHa2#l zzrX)}B3h!yTGl(OM7$>3h-g_)PtWGT!NHeCMn*pIcs!rgvxkR=2aX&$vZuGVw}*(9 z6HzBqizAch{xGe&I(iO`p%_d7k8#G$QrXQ%|lmh)9!& zwD?%fPBoT9J~=trrR(}l%d%8_j%8V@uIqOuCME*K@;7UmcH3|8jfur#cb(P9n+6dH zn5OCb%x{conrkA`4KI{LqyZ z0Js;+6zEpq!fNjCpH^*wZUw$1OB$*&0!a%FM_l+W=QG+QI=@^tE|5CC`_&knyY4DsTdmVW|C3-*UM-|PJ2>~Eg{z?JCc8?`d7`~C@xYnkwE zioG&5CE$f`4T4##0eB@HHoJHJS|p@~R;F#5&32I7CF+M@B~W&(6+Hsj8|)qfz`URaLdQxw(g9V`B$Iq`eS)dKEfF zWJp9tMdYB*H7X**A`*}iUbi-g{hqeNIndAQa99d%oqFmiBYy$dEvwnH;_K`H0000< KMNUMnLSTX*yQ91S literal 0 HcmV?d00001 diff --git a/src/ru/yaoichan/res/mipmap-xhdpi/ic_launcher.png b/src/ru/yaoichan/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..30ff23252a0725c424c131ba4587ec8d27199037 GIT binary patch literal 1910 zcmV-+2Z{KJP) zTWl0n7{|YMw=KQU7TSag)C)+Ui3!($J{SoPL?6^>BrzIDtntAZOvD#&ktzskFhS$> z!ApZNM0_xch7i=&3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_<9c|8JzVuvn7zijKgwR#J`!VL zz8weNjkBL`#eg?r?8`k~iUQ9^fTts@*FQJ|yc)Cos|a%8UI89~3vd`Nz+t!mhv5Po zh6`{Q%LOP(d0ggo3swp6X#x_7L}}0EU5qG-Nh<|364CN&*REY~x?yf16bcQKMe7In zh%H9baq85mmz{2y8&DJleSLkekwq(LXlux{wYRsgy>jKsC8rx$?u?F(Uf#HI<9Z@$ zBMa7$`EL~^B3ij?*RCDI!^8iGVv%1X=|R%zG)6{7E_Zi#-$iWvZzhY@64QpEHX^#Q zv$JzcZ*TAGgM)*^h0l51>iEHN}RG;-p^iTAp?x^5++o7AiKg;B>(^b literal 0 HcmV?d00001 diff --git a/src/ru/yaoichan/res/mipmap-xxhdpi/ic_launcher.png b/src/ru/yaoichan/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..df3af6c1a541db9f97f9b99f0fda74639e8ba07d GIT binary patch literal 3460 zcmZ8k3p^9t`=8A%Tdo<&b(6>~S>-ZXEapDB#z^sMEOOV%ZAmuwrQAXqxr~^QEV6Q& zQY@i}*6@=1CDNy_f=lEjRC7x(w6a6?zO#j~D*#1zAZgzHc>WL@15 z>hX}G3u$h{&5Z^jMU~^#l(%J4zk=Wjx|*6+x24}9tQ5Sw6YuLjZmv{oHlq&7+Gi8SGR<#P%F zs_*;J;+QH&eOk4MQoZ%{%P`?q|4f3C(GK(SQ(ouW)dcO0wwK4De{px?c zih&i~r!TArp9AzNuV4A`35^(L*VLupo_~yYfYUzo2W&*N=mY#E9EM$CMV4qKb&Uf) zi@h40J1e!helf? zZ;U`vTMEV@kuIvnKmwe$AKlFOSE`GM2rhMvI$ahBtzNHgMlI`L{htF39{Z8xy&0$s zT~F0sXr?ySOXLi5ryp#ED{mA`n`aG{vo2b)9-iXnmF*C%C9kLoBF)9(3?V-dVv4qa z{G%he1T-i?QK(cA^h{Z})R`1=c&%KNVJfzi4%F{W@|b4blVP2cVV!qrrviT60wl7;rR zc)z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h?={TXkCM z+KYdnAAomY*?k_75|l?EaDYe?>cPt{U?XZ8L#ku{!(4KE`05|#HVpe1sUrzSII58% zD1VDQs7_@T8w`}rkWri9VGSoka5vCq04OVC{jZHnZgw(#Iud+o=H{}rP;em0vkbRS zM$=ny|FK^mEwve_7)^DoIk6}nRj}IIgfi()Al7amb{Ap}MC$Rk!e)Ur?9X4a zA*zFILq~Dfoe4a|Zjy!yqvlsB=(Ys38fT6HZT{rLHYnf15vr-jrV~JK#@>SP!Ld@Cs(BxbRCY^+PKs{rrNxPOTkeY$h*P!W7 zi6EaF>%WSg@%?ju3}7I5rWa7BmDtqPR6d_!ahBVAC%^7S&2WLw-s2X zqy7xNq_8LQ8U_EQ(&4VM@zt;M6Zv{Rwl}-ZSDcA{Y}Ry&gV@WrLZ@3e-~PJ0+L;)& zIQq~@nsZdTyy2{sp3myD3RHxJ^J9x93ZB|GefIIyt%a5YCqm>|aPh={-ynn4n5XNL4+_*Jw z{WLTAuHA(Qdj5^&^uHBw?8Pa<46TptaDt-tG{3$XDf@*Pp+=x-NS`jq?+#-m-}pSK zzS20LYOwS#I%I~{#m*dK-%$*AYoG16vQ_skhe|h%_)1TDn_9b-zhGDm9Y z$iNEBnMw^8M5OD%0ppyv?~08+*dOf)$SNY+7+*gxfAjyz_RqwZf<4id30wL6-xa{- Mv?IFS!teV308q(rh5!Hn literal 0 HcmV?d00001 diff --git a/src/ru/yaoichan/res/mipmap-xxxhdpi/ic_launcher.png b/src/ru/yaoichan/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..208623080ebf0cd75587116c4e92f28cc976f601 GIT binary patch literal 4286 zcmaJl2{=^!*LP+tgD`^-O?Jwj^|g&9WQ!^DMoNQh$x@b7G&9*tBzv||5-CPWmN0{4 z-?EG-Lm`wUOblb@o8JHTJqaZ@1;QJA5-`-JjKr~bnQD@l=r9ei?v<} zZFVHRgfeILAk+iWoW-1GFI<8SR=6u?|GgAh88!sY;#a$iNwB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Ii$IL!TAVaN}nW+91&7!^yrvr`@(`P*#9K}TPsJ)DhrR8{{lIC`2PR^ literal 0 HcmV?d00001 diff --git a/src/ru/yaoichan/res/web_hi_res_512.png b/src/ru/yaoichan/res/web_hi_res_512.png new file mode 100644 index 0000000000000000000000000000000000000000..1d33fc5a7a72029f2916dd79961a1f8707977690 GIT binary patch literal 13398 zcmeHui93|-+weWZSc?`*LKH%>l*(?jF+(U4vOWpPo}HLcqDA(7eX5y6LfO}uC=ybm ztTCi$5~fT{W6b?s)BC>tzQ5u7UdQ3U+}C|x=f1mj+RALR&`u!;f;M9@Cu|@H34TRF z0({^HBl0~9g5)9WiKAyDixww+@-Eu_)BR(Idvvr!qSSEwKPH~(mWZvA?{7-;qE5ct zapq{ytzdU!pMK-2lGiPi7bNS>P^@A)sMxhUFpd~i2Gf0|hcmFixJd~ZaY(ZKwck{(c zejwW05oU!c#`o%+!e^c?AU#4!{zWLarqt1B_EP3Dw=LhPg6vCmXv>y=`w z{moxiw^00DY~_E(mg}ns$4lFLv|m2B3eTWCK{fwW-W zxJodHrnngSO#G`N=_Nk-t@7DKo?W=XbzE*LsV}{Ma5D3^%=mTw_-Ms}O~$q67md3* zr?n@Cb2;y|MRzy;>i32pKks^FZ9qvipsY<$8lAkH4Vdd5PSmS&K_V!!xKTdoh4H&A z&b@s`hMJ4bn97V=1&Iy-*f>FOb! zI zec1vnl`wf%miF){B;q|0N6qGFsVLyS=hw8gDo<*w?9J~GOV(}pH2`y#jy`X$_4Z-} z$nw$$uA{pwU1*6Zp&Rlyt9=T$;q07PUVUuCTpi-zVPfA-N{=+fOq!CkKzSKPyRJRA zd)m#L5b?g>J3PQHI@XTWbDOayPD_5qsLY6p)a{Tr+OH|Q)7+_+QWbxwIQ`tf&IKOY z(R)#En`#0$ezFs!i+OjE)7N66=g^(=*@Pz+k*`w~*z?kbUUw&-QR440>`}Bpi#g4k zBlZJsb)}aI?6>2-R>mcd|W2vX*=2t&6ih}x_86W^jY{73Jy-%iGis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I zLGG>{=B-{tJK+S5l@#r$o^5#C@By5$>+dd5(J;$*=C8Fkt`TDRo*&wd{mwD(z&xBj zyJuzJ*Q%0ct$p8X8|AoV%>Vwg#{U=pw89ZZw#Li2?(2UIfiLVys}ohn+^_u~G=*W$ literal 0 HcmV?d00001 diff --git a/src/ru/yaoichan/src/eu/kanade/tachiyomi/extension/ru/yaoichan/Yaoichan.kt b/src/ru/yaoichan/src/eu/kanade/tachiyomi/extension/ru/yaoichan/Yaoichan.kt new file mode 100644 index 000000000..36032efd8 --- /dev/null +++ b/src/ru/yaoichan/src/eu/kanade/tachiyomi/extension/ru/yaoichan/Yaoichan.kt @@ -0,0 +1,269 @@ +package eu.kanade.tachiyomi.extension.ru.yaoichan + +import eu.kanade.tachiyomi.annotations.Nsfw +import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor +import eu.kanade.tachiyomi.network.GET +import eu.kanade.tachiyomi.source.model.Filter +import eu.kanade.tachiyomi.source.model.FilterList +import eu.kanade.tachiyomi.source.model.Page +import eu.kanade.tachiyomi.source.model.SChapter +import eu.kanade.tachiyomi.source.model.SManga +import eu.kanade.tachiyomi.source.online.ParsedHttpSource +import java.text.SimpleDateFormat +import java.util.Locale +import okhttp3.OkHttpClient +import okhttp3.Request +import okhttp3.Response +import org.jsoup.nodes.Document +import org.jsoup.nodes.Element + +@Nsfw +class Yaoichan : ParsedHttpSource() { + + override val name = "Yaoichan" + + override val baseUrl = "https://yaoi-chan.me" + + override val lang = "ru" + + override val supportsLatest = true + + private val rateLimitInterceptor = RateLimitInterceptor(2) + + override val client: OkHttpClient = network.client.newBuilder() + .addNetworkInterceptor(rateLimitInterceptor).build() + + override fun popularMangaRequest(page: Int): Request = + GET("$baseUrl/mostfavorites?offset=${20 * (page - 1)}", headers) + + override fun latestUpdatesRequest(page: Int): Request = + GET("$baseUrl/manga/new?offset=${20 * (page - 1)}", headers) + + override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { + val url = if (query.isNotEmpty()) { + "$baseUrl/?do=search&subaction=search&story=$query&search_start=$page" + } else { + + var genres = "" + var order = "" + var statusParam = true + var status = "" + for (filter in if (filters.isEmpty()) getFilterList() else filters) { + when (filter) { + is GenreList -> { + filter.state.forEach { f -> + if (!f.isIgnored()) { + genres += (if (f.isExcluded()) "-" else "") + f.id + '+' + } + } + } + is OrderBy -> { + if (filter.state!!.ascending && filter.state!!.index == 0) { + statusParam = false + } + } + is Status -> status = arrayOf("", "all_done", "end", "ongoing", "new_ch")[filter.state] + } + } + + if (genres.isNotEmpty()) { + for (filter in filters) { + when (filter) { + is OrderBy -> { + order = if (filter.state!!.ascending) { + arrayOf("", "&n=favasc", "&n=abcdesc", "&n=chasc")[filter.state!!.index] + } else { + arrayOf("&n=dateasc", "&n=favdesc", "&n=abcasc", "&n=chdesc")[filter.state!!.index] + } + } + } + } + if (statusParam) { + "$baseUrl/tags/${genres.dropLast(1)}$order?offset=${20 * (page - 1)}&status=$status" + } else { + "$baseUrl/tags/$status/${genres.dropLast(1)}/$order?offset=${20 * (page - 1)}" + } + } else { + for (filter in filters) { + when (filter) { + is OrderBy -> { + order = if (filter.state!!.ascending) { + arrayOf("manga/new", "manga/new&n=favasc", "manga/new&n=abcdesc", "manga/new&n=chasc")[filter.state!!.index] + } else { + arrayOf("manga/new&n=dateasc", "mostfavorites", "catalog", "sortch")[filter.state!!.index] + } + } + } + } + if (statusParam) { + "$baseUrl/$order?offset=${20 * (page - 1)}&status=$status" + } else { + "$baseUrl/$order/$status?offset=${20 * (page - 1)}" + } + } + } + return GET(url, headers) + } + + override fun popularMangaSelector() = "div.content_row" + + override fun latestUpdatesSelector() = popularMangaSelector() + + override fun searchMangaSelector() = popularMangaSelector() + + override fun popularMangaFromElement(element: Element): SManga { + val manga = SManga.create() + manga.thumbnail_url = element.select("div.manga_images img").first().attr("src") + element.select("h2 > a").first().let { + manga.setUrlWithoutDomain(it.attr("href")) + manga.title = it.text() + } + return manga + } + + override fun latestUpdatesFromElement(element: Element): SManga = popularMangaFromElement(element) + + override fun searchMangaFromElement(element: Element): SManga = popularMangaFromElement(element) + + override fun popularMangaNextPageSelector() = "a:contains(Вперед)" + + override fun latestUpdatesNextPageSelector() = popularMangaNextPageSelector() + + override fun searchMangaNextPageSelector() = "a:contains(Далее), ${popularMangaNextPageSelector()}" + + override fun mangaDetailsParse(document: Document): SManga { + val infoElement = document.select("table.mangatitle").first() + val descElement = document.select("div#description").first() + val imgElement = document.select("img#cover").first() + val rawCategory = infoElement.select("tr:eq(1) > td:eq(1)").text() + val category = if (rawCategory.isNotEmpty()) { + rawCategory.toLowerCase() + } else { + "манга" + } + val manga = SManga.create() + manga.author = infoElement.select("tr:eq(2) > td:eq(1)").text() + manga.genre = infoElement.select("tr:eq(5) > td:eq(1)").text().split(",").plusElement(category).joinToString { it.trim() } + manga.status = parseStatus(infoElement.select("tr:eq(4) > td:eq(1)").text()) + manga.description = descElement.textNodes().first().text() + manga.thumbnail_url = imgElement.attr("src") + return manga + } + + private fun parseStatus(element: String): Int = when { + element.contains("перевод завершен") -> SManga.COMPLETED + element.contains("перевод продолжается") -> SManga.ONGOING + else -> SManga.UNKNOWN + } + + override fun chapterListSelector() = "table.table_cha tr:gt(1)" + + override fun chapterFromElement(element: Element): SChapter { + val urlElement = element.select("a").first() + + val chapter = SChapter.create() + chapter.setUrlWithoutDomain(urlElement.attr("href")) + chapter.name = urlElement.text() + chapter.date_upload = element.select("div.date").first()?.text()?.let { + SimpleDateFormat("yyyy-MM-dd", Locale.US).parse(it).time + } ?: 0 + return chapter + } + + override fun pageListParse(response: Response): List { + val html = response.body()!!.string() + val beginIndex = html.indexOf("fullimg\":[") + 10 + val endIndex = html.indexOf(",]", beginIndex) + val trimmedHtml = html.substring(beginIndex, endIndex).replace("\"", "") + val pageUrls = trimmedHtml.split(',') + + return pageUrls.mapIndexed { i, url -> Page(i, "", url) } + } + + override fun pageListParse(document: Document): List { + throw Exception("Not used") + } + + override fun imageUrlParse(document: Document) = "" + + private class GenreList(genres: List) : Filter.Group("Тэги", genres) + private class Genre(name: String, val id: String = name.replace(' ', '_')) : Filter.TriState(name) + private class Status : Filter.Select("Статус", arrayOf("Все", "Перевод завершен", "Выпуск завершен", "Онгоинг", "Новые главы")) + private class OrderBy : Filter.Sort("Сортировка", + arrayOf("Дата", "Популярность", "Имя", "Главы"), + Selection(1, false)) + + override fun getFilterList() = FilterList( + Status(), + OrderBy(), + GenreList(getGenreList()) + ) + + /* [...document.querySelectorAll("li.sidetag > a:nth-child(1)")] + * .map(el => `Genre("${el.getAttribute('href').substr(6)}")`).join(',\n') + * on https://yaoi-chan.me/catalog + */ + private fun getGenreList() = listOf( + Genre("18 плюс"), + Genre("bdsm"), + Genre("арт"), + Genre("бара"), + Genre("боевик"), + Genre("боевые искусства"), + Genre("вампиры"), + Genre("веб"), + Genre("гарем"), + Genre("гендерная интрига"), + Genre("героическое фэнтези"), + Genre("групповой секс"), + Genre("детектив"), + Genre("дзёсэй"), + Genre("додзинси"), + Genre("драма"), + Genre("игра"), + Genre("инцест"), + Genre("искусство"), + Genre("история"), + Genre("киберпанк"), + Genre("комедия"), + Genre("литРПГ"), + Genre("махо-сёдзё"), + Genre("меха"), + Genre("мистика"), + Genre("мужская беременность"), + Genre("музыка"), + Genre("научная фантастика"), + Genre("омегаверс"), + Genre("переодевание"), + Genre("повседневность"), + Genre("постапокалиптика"), + Genre("приключения"), + Genre("психология"), + Genre("романтика"), + Genre("самурайский боевик"), + Genre("сборник"), + Genre("сверхъестественное"), + Genre("сетакон"), + Genre("сказка"), + Genre("спорт"), + Genre("супергерои"), + Genre("сэйнэн"), + Genre("сёдзё"), + Genre("сёдзё-ай"), + Genre("сёнэн"), + Genre("сёнэн-ай"), + Genre("тентакли"), + Genre("трагедия"), + Genre("триллер"), + Genre("ужасы"), + Genre("фантастика"), + Genre("фурри"), + Genre("фэнтези"), + Genre("школа"), + Genre("эротика"), + Genre("юмор"), + Genre("юри"), + Genre("яой"), + Genre("ёнкома") + ) +}