mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-25 12:12:34 +01:00
[instagram] make post-page extraction nonfatal
This commit is contained in:
parent
922b8a9595
commit
72b8fbfbad
@ -109,8 +109,14 @@ class InstagramExtractor(Extractor):
|
||||
return data
|
||||
|
||||
def _extract_postpage(self, url):
|
||||
data = self.request(url + "?__a=1").json()
|
||||
media = data['graphql']['shortcode_media']
|
||||
try:
|
||||
with self.request(url + '?__a=1', fatal=False) as response:
|
||||
media = response.json()['graphql']['shortcode_media']
|
||||
except (KeyError, ValueError) as exc:
|
||||
self.log.warning("Unable to fetch data from '%s': %s: %s",
|
||||
url, exc.__class__.__name__, exc)
|
||||
self.log.debug("Server response: %s", response.text)
|
||||
return ()
|
||||
|
||||
common = {
|
||||
'date': text.parse_timestamp(media['taken_at_timestamp']),
|
||||
|
Loading…
Reference in New Issue
Block a user