Browse Source

Get genres from JDB autofill

xoru 1 year ago
parent
commit
dd06282980
1 changed files with 74 additions and 0 deletions
  1. 74
    0
      sections/ajax/autofill/jav.php

+ 74
- 0
sections/ajax/autofill/jav.php View File

@@ -144,6 +144,80 @@ if (!$debug && $Cache->get_value('jav_fill_json_'.$cn)) {
144 144
       //Shit neither of the sites have descriptions
145 145
       $desc = '';
146 146
     }
147
+    if (!$genres) {
148
+      // Mapping of JDB genres that are different to ours.
149
+      $jdb_genre_map = [
150
+        'Actress Best Compilation' => 'compilation',
151
+        'Adultery' => 'cheating',
152
+        'Anal Sex' => 'anal',
153
+        'Big Tits' => 'big.breasts:female',
154
+        'Big Tits Lover' => 'big.breasts:female',
155
+        'Big Vibrator' => 'sex.toys',
156
+        'Bunny Girl' => 'bunny.girl',
157
+        'Cat Cosplay' => 'catgirl',
158
+        'Cheating Wife' => 'cheating',
159
+        'Chinese Dress' => 'chinese.dress',
160
+        'Creampie' => 'nakadashi',
161
+        'Cross Dresser' => 'crossdressing',
162
+        'Cum Swallowing' => 'gokkun',
163
+        'Deep Throat' => 'deepthroat',
164
+        'Drunk Girl' => 'drunk',
165
+        'Egg Vibrator' => 'sex.toys',
166
+        'Face Sitting' => 'facesitting',
167
+        'Female Ninja' => 'ninja',
168
+        'Female Teacher' => 'teacher',
169
+        'Gal' => 'gyaru:female',
170
+        'Gay' => 'yaoi:male',
171
+        'Golden Shower' => 'urination',
172
+        'Huge Tits' => 'huge.breasts',
173
+        'Hypnotism' => 'hypnosis',
174
+        'Kiss Kiss' => 'kissing',
175
+        'Leotards' => 'leotard',
176
+        'Lesbian' => 'yuri:female',
177
+        'Lesbian Kissing' => ['yuri:female', 'kissing'],
178
+        'Lotion' => 'oil',
179
+        'Massage Parlor' => 'massage',
180
+        'MILF' => 'milf:female',
181
+        'Muscular' => 'muscle',
182
+        'Naked Apron' => 'apron',
183
+        'Non-nude Erotica' => 'nonnude',
184
+        'Office Lady' => 'office.lady:female',
185
+        'Older Sister' => ['oneesan:female', 'sister:female'],
186
+        'Orgy' => 'group',
187
+        'Pregnant' => 'pregnant:female',
188
+        'Private Tutor' => 'tutor',
189
+        'Race Queen' => 'race.queen',
190
+        'Relatives' => 'incest',
191
+        'Sailor Uniform' => 'schoolgirl.uniform:female',
192
+        'School Swimsuits' => 'school.swimsuit',
193
+        'School Uniform' => 'schoolgirl.uniform:female',
194
+        'Schoolgirl' => 'schoolgirl:female',
195
+        'Sex Toys' => 'sex.toys',
196
+        'Shaved Pussy' => 'shaved:female',
197
+        'Shotacon' => 'shotacon:male',
198
+        'Sister' => 'sister:female',
199
+        'Small Tits' => 'small.breasts:female',
200
+        'Substance Use' => 'drugs',
201
+        'Swimsuits' => 'swimsuit',
202
+        'Tall Girl' => 'tall.girl',
203
+        'Threesome / Foursome' => 'threesome',
204
+        'Titty Fuck' => 'paizuri',
205
+        'Vibrator' => 'sex.toys',
206
+        'Voyeur' => 'voyeurism',
207
+        'Waitress' => 'waiter',
208
+      ];
209
+      foreach ($jdb->query("//a[@rel='tag' and starts-with(@href, 'https://www.javdatabase.com/genres/')]") as $tag) {
210
+        if (array_key_exists($tag->nodeValue, $jdb_genre_map)) {
211
+          if (is_array($jdb_genre_map[$tag->nodeValue])) {
212
+            $genres += $jdb_genre_map[$tag->nodeValue];
213
+          } else {
214
+            $genres[] = $jdb_genre_map[$tag->nodeValue];
215
+          }
216
+        } else {
217
+          $genres[] = strtolower($tag->nodeValue);
218
+        }
219
+      }
220
+    }
147 221
   }
148 222
 
149 223
   if (!($title || $idols || $year || $studio || $label || $genres)) {

Loading…
Cancel
Save