1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-25 04:02:32 +01:00

[newgrounds] fix warning for age-restricted posts (#6005)

This commit is contained in:
Mike Fährmann 2024-08-13 07:40:44 +02:00
parent 54e1023046
commit c495bfe460
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -171,15 +171,17 @@ class NewgroundsExtractor(Extractor):
if self.flash:
url += "/format/flash"
with self.request(url, fatal=False) as response:
if response.status_code >= 400:
return {}
page = response.text
response = self.request(url, fatal=False)
page = response.text
pos = page.find('id="adults_only"')
if pos >= 0:
msg = text.extract(page, 'class="highlight">', '<', pos)[0]
self.log.warning('"%s"', msg)
return {}
if response.status_code >= 400:
return {}
extr = text.extract_from(page)
data = extract_data(extr, post_url)