From 7017c9e73fb985735e64a9cac26562c663f90f93 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Fri, 21 Jan 2022 02:27:11 +0100 Subject: [PATCH] [instagram] fix video extraction --- src/you_get/extractors/instagram.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/you_get/extractors/instagram.py b/src/you_get/extractors/instagram.py index f22bc60d..0ed31cbc 100755 --- a/src/you_get/extractors/instagram.py +++ b/src/you_get/extractors/instagram.py @@ -50,6 +50,20 @@ def instagram_download(url, output_dir='.', merge=True, info_only=False, **kwarg total_size=size, output_dir=output_dir) + # download videos (if any) + if 'video_versions' in media: + video_url = media['video_versions'][0]['url'] + ext = video_url.split('?')[0].split('.')[-1] + size = int(get_head(video_url)['Content-Length']) + + print_info(site_info, title, ext, size) + if not info_only: + download_urls(urls=[video_url], + title=title, + ext=ext, + total_size=size, + output_dir=output_dir) + site_info = "Instagram.com" download = instagram_download download_playlist = playlist_not_supported('instagram')