3 Commits

Author SHA1 Message Date
  xoru 732a457630 Fix JAV request autofill 5 years ago
  xoru dd06282980 Get genres from JDB autofill 5 years ago
  xoru ed8d410a1f Fix title (again) 5 years ago
2 changed files with 2 additions and 76 deletions
  1. 1
    75
      sections/ajax/autofill/jav.php
  2. 1
    1
      static/functions/requests.js

+ 1
- 75
sections/ajax/autofill/jav.php View File

@@ -108,7 +108,7 @@ if (!$debug && $Cache->get_value('jav_fill_json_'.$cn)) {
108 108
   }
109 109
   if ($jdb_page) {
110 110
     if (!$title) {
111
-      $title = trim($jdb->query("//b[contains(., 'Translated Title:')]")[0]->nextSibling->nodeValue);
111
+      $title = trim(substr($jdb->query("//h1[contains(@class, 'entry-title')]")[0]->nodeValue, strlen($cn) + 3));
112 112
     }
113 113
     if (!$studio) {
114 114
       $studio = $jdb->query("//b[contains(., 'Studio:')]")[0]->nextSibling->nodeValue;
@@ -144,80 +144,6 @@ 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
-    }
221 147
   }
222 148
 
223 149
   if (!($title || $idols || $year || $studio || $label || $genres)) {

+ 1
- 1
static/functions/requests.js View File

@@ -207,7 +207,7 @@ function JavAutofill() {
207 207
                tags: 'tags',
208 208
                description: 'req_desc' }
209 209
   var cn = $('#catalogue').raw().value.toUpperCase()
210
-  $.getJSON('/ajax.php?action=autofill&cat=jav&cn='+cn, function(data) {
210
+  $.getJSON('/ajax.php?action=javfill&cn='+cn, function(data) {
211 211
     if (data.status != "success") {
212 212
       $('#catalogue').raw().value = 'Failed'
213 213
       return

Loading…
Cancel
Save