diff options
author | bopol <bopol@e.email> | 2021-04-05 13:23:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-05 16:53:33 +0530 |
commit | c24ce07a84ec440fdfd8a050fd6019393a50577b (patch) | |
tree | e076dd0cb37c2b382fb0e37e0ea98671ae8f029b | |
parent | de6758128e41f87d3b52069d83ece31abc1c287b (diff) | |
download | hypervideo-pre-c24ce07a84ec440fdfd8a050fd6019393a50577b.tar.lz hypervideo-pre-c24ce07a84ec440fdfd8a050fd6019393a50577b.tar.xz hypervideo-pre-c24ce07a84ec440fdfd8a050fd6019393a50577b.zip |
[nitter] Fix thumbnails (#216)
Authored by: B0pol
-rw-r--r-- | yt_dlp/extractor/nitter.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/yt_dlp/extractor/nitter.py b/yt_dlp/extractor/nitter.py index 3191543ed..15688b608 100644 --- a/yt_dlp/extractor/nitter.py +++ b/yt_dlp/extractor/nitter.py @@ -131,10 +131,10 @@ class NitterIE(InfoExtractor): repost_count = parse_count(self._html_search_regex(r'<span[^>]+class="icon-retweet[^>]*></span>\s([^<]+)</div>', webpage, 'repost count', fatal=False)) comment_count = parse_count(self._html_search_regex(r'<span[^>]+class="icon-comment[^>]*></span>\s([^<]+)</div>', webpage, 'repost count', fatal=False)) - thumbnail = base_url + (self._html_search_meta('og:image', webpage, 'thumbnail url') - or self._html_search_regex(r'<video[^>]+poster="([^"]+)"', webpage, 'thumbnail url', fatal=False)) - - thumbnail = remove_end(thumbnail, '%3Asmall') # if parsed with regex, it should contain this + thumbnail = self._html_search_meta('og:image', webpage, 'thumbnail url') + if not thumbnail: + thumbnail = base_url + self._html_search_regex(r'<video[^>]+poster="([^"]+)"', webpage, 'thumbnail url', fatal=False) + thumbnail = remove_end(thumbnail, '%3Asmall') thumbnails = [] thumbnail_ids = ('thumb', 'small', 'large', 'medium', 'orig') |