1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 18:53:21 +01:00

[instagram] implement 'videos' option (closes #521)

This commit is contained in:
Mike Fährmann 2019-12-19 17:15:41 +01:00
parent 1921c127a5
commit 95c90722ee
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
3 changed files with 17 additions and 2 deletions

View File

@ -770,6 +770,15 @@ Description Include *Story Highlights* when downloading a user profile.
=========== ===== =========== =====
extractor.instagram.videos
--------------------------
=========== =====
Type ``bool``
Default ``true``
Description Download video files.
=========== =====
extractor.kissmanga.captcha extractor.kissmanga.captcha
--------------------------- ---------------------------
=========== ===== =========== =====

View File

@ -72,7 +72,8 @@
}, },
"instagram": "instagram":
{ {
"highlights": false "highlights": false,
"videos": true
}, },
"kissmanga": "kissmanga":
{ {

View File

@ -31,6 +31,7 @@ class InstagramExtractor(Extractor):
self.login() self.login()
yield Message.Version, 1 yield Message.Version, 1
videos = self.config("videos", True)
metadata = self.get_metadata() metadata = self.get_metadata()
for data in self.instagrams(): for data in self.instagrams():
data.update(metadata) data.update(metadata)
@ -41,7 +42,11 @@ class InstagramExtractor(Extractor):
data['_extractor'] = InstagramStoriesExtractor data['_extractor'] = InstagramStoriesExtractor
yield Message.Queue, url, data yield Message.Queue, url, data
else: else:
url = data.get('video_url') or data['display_url'] url = data.get('video_url')
if not url:
url = data['display_url']
elif not videos:
continue
yield Message.Url, url, text.nameext_from_url(url, data) yield Message.Url, url, text.nameext_from_url(url, data)
def login(self): def login(self):