mirror of
https://github.com/l1ving/youtube-dl
synced 2020-11-18 19:53:54 -08:00
Correcting title & ext
This commit is contained in:
parent
8e0d60145a
commit
92ecd66a20
@ -126,6 +126,9 @@ class InstagramIE(InfoExtractor):
|
|||||||
uploader_id, like_count, comment_count, comments, height,
|
uploader_id, like_count, comment_count, comments, height,
|
||||||
width) = [None] * 11
|
width) = [None] * 11
|
||||||
|
|
||||||
|
ext = 'mp4'
|
||||||
|
media_type = 'Video'
|
||||||
|
|
||||||
shared_data = self._parse_json(
|
shared_data = self._parse_json(
|
||||||
self._search_regex(
|
self._search_regex(
|
||||||
r'window\._sharedData\s*=\s*({.+?});',
|
r'window\._sharedData\s*=\s*({.+?});',
|
||||||
@ -148,10 +151,15 @@ class InstagramIE(InfoExtractor):
|
|||||||
|
|
||||||
elif media.get('display_resources'):
|
elif media.get('display_resources'):
|
||||||
display_resource = media['display_resources'][-1] # choosing highest resolution
|
display_resource = media['display_resources'][-1] # choosing highest resolution
|
||||||
|
|
||||||
media_url = display_resource.get('src')
|
media_url = display_resource.get('src')
|
||||||
height = int_or_none(display_resource.get('config_height'))
|
height = int_or_none(display_resource.get('config_height'))
|
||||||
width = int_or_none(display_resource.get('config_width'))
|
width = int_or_none(display_resource.get('config_width'))
|
||||||
|
|
||||||
|
if media_url:
|
||||||
|
ext = media_url.split('?', 1)[0].rsplit('.', 1)[-1]
|
||||||
|
media_type = 'Image'
|
||||||
|
|
||||||
description = try_get(
|
description = try_get(
|
||||||
media, lambda x: x['edge_media_to_caption']['edges'][0]['node']['text'],
|
media, lambda x: x['edge_media_to_caption']['edges'][0]['node']['text'],
|
||||||
compat_str) or media.get('caption')
|
compat_str) or media.get('caption')
|
||||||
@ -228,8 +236,8 @@ class InstagramIE(InfoExtractor):
|
|||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
'ext': 'mp4',
|
'ext': ext,
|
||||||
'title': 'Video by %s' % uploader_id,
|
'title': '%s by %s' % (media_type, uploader_id),
|
||||||
'description': description,
|
'description': description,
|
||||||
'thumbnail': thumbnail,
|
'thumbnail': thumbnail,
|
||||||
'timestamp': timestamp,
|
'timestamp': timestamp,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user