]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/nitter.py
[ie/crunchyroll] Fix stream extraction (#10005)
[yt-dlp.git] / yt_dlp / extractor / nitter.py
index 8bb709cd7ec76fc315fab62078dd1c8e751ef110..35d1311dcdcdd7165e2f9a56c575656fd871de37 100644 (file)
@@ -1,6 +1,3 @@
-# coding: utf-8
-from __future__ import unicode_literals
-
 from .common import InfoExtractor
 from ..compat import compat_urlparse
 from ..utils import (
@@ -42,59 +39,99 @@ class NitterIE(InfoExtractor):
     )
 
     HTTP_INSTANCES = (
-        'nitter.42l.fr',
-        'nitter.pussthecat.org',
-        'nitter.nixnet.services',
+        'nitter.lacontrevoie.fr',
         'nitter.fdn.fr',
         'nitter.1d4.us',
         'nitter.kavin.rocks',
         'nitter.unixfox.eu',
         'nitter.domain.glass',
-        'nitter.eu',
         'nitter.namazso.eu',
-        'nitter.actionsack.com',
         'birdsite.xanny.family',
-        'nitter.hu',
-        'twitr.gq',
         'nitter.moomoo.me',
-        'nittereu.moomoo.me',
-        'bird.from.tf',
+        'bird.trom.tf',
         'nitter.it',
         'twitter.censors.us',
-        'twitter.grimneko.de',
-        'nitter.alefvanoon.xyz',
-        'n.hyperborea.cloud',
-        'nitter.ca',
+        'nitter.grimneko.de',
         'twitter.076.ne.jp',
-        'twitter.mstdn.social',
         'nitter.fly.dev',
         'notabird.site',
         'nitter.weiler.rocks',
-        'nitter.silkky.cloud',
         'nitter.sethforprivacy.com',
-        'nttr.stream',
         'nitter.cutelab.space',
         'nitter.nl',
         'nitter.mint.lgbt',
         'nitter.bus-hit.me',
-        'fuckthesacklers.network',
-        'nitter.govt.land',
-        'nitter.datatunnel.xyz',
         'nitter.esmailelbob.xyz',
         'tw.artemislena.eu',
-        'de.nttr.stream',
         'nitter.winscloud.net',
         'nitter.tiekoetter.com',
         'nitter.spaceint.fr',
-        'twtr.bch.bar',
-        'nitter.exonip.de',
-        'nitter.mastodon.pro',
-        'nitter.notraxx.ch',
-
-
-        # not in the list anymore
-        'nitter.skrep.in',
-        'nitter.snopyta.org',
+        'nitter.privacy.com.de',
+        'nitter.poast.org',
+        'nitter.bird.froth.zone',
+        'nitter.dcs0.hu',
+        'twitter.dr460nf1r3.org',
+        'nitter.garudalinux.org',
+        'twitter.femboy.hu',
+        'nitter.cz',
+        'nitter.privacydev.net',
+        'nitter.evil.site',
+        'tweet.lambda.dance',
+        'nitter.kylrth.com',
+        'nitter.foss.wtf',
+        'nitter.priv.pw',
+        'nitter.tokhmi.xyz',
+        'nitter.catalyst.sx',
+        'unofficialbird.com',
+        'nitter.projectsegfau.lt',
+        'nitter.eu.projectsegfau.lt',
+        'singapore.unofficialbird.com',
+        'canada.unofficialbird.com',
+        'india.unofficialbird.com',
+        'nederland.unofficialbird.com',
+        'uk.unofficialbird.com',
+        'n.l5.ca',
+        'nitter.slipfox.xyz',
+        'nitter.soopy.moe',
+        'nitter.qwik.space',
+        'read.whatever.social',
+        'nitter.rawbit.ninja',
+        'nt.vern.cc',
+        'ntr.odyssey346.dev',
+        'nitter.ir',
+        'nitter.privacytools.io',
+        'nitter.sneed.network',
+        'n.sneed.network',
+        'nitter.manasiwibi.com',
+        'nitter.smnz.de',
+        'nitter.twei.space',
+        'nitter.inpt.fr',
+        'nitter.d420.de',
+        'nitter.caioalonso.com',
+        'nitter.at',
+        'nitter.drivet.xyz',
+        'nitter.pw',
+        'nitter.nicfab.eu',
+        'bird.habedieeh.re',
+        'nitter.hostux.net',
+        'nitter.adminforge.de',
+        'nitter.platypush.tech',
+        'nitter.mask.sh',
+        'nitter.pufe.org',
+        'nitter.us.projectsegfau.lt',
+        'nitter.arcticfoxes.net',
+        't.com.sb',
+        'nitter.kling.gg',
+        'nitter.ktachibana.party',
+        'nitter.riverside.rocks',
+        'nitter.girlboss.ceo',
+        'nitter.lunar.icu',
+        'twitter.moe.ngo',
+        'nitter.freedit.eu',
+        'ntr.frail.duckdns.org',
+        'nitter.librenode.org',
+        'n.opnxng.com',
+        'nitter.plus.st',
     )
 
     DEAD_INSTANCES = (
@@ -120,6 +157,32 @@ class NitterIE(InfoExtractor):
         'nitter.weaponizedhumiliation.com',
         'nitter.vxempire.xyz',
         'tweet.lambda.dance',
+        'nitter.ca',
+        'nitter.42l.fr',
+        'nitter.pussthecat.org',
+        'nitter.nixnet.services',
+        'nitter.eu',
+        'nitter.actionsack.com',
+        'nitter.hu',
+        'twitr.gq',
+        'nittereu.moomoo.me',
+        'bird.from.tf',
+        'twitter.grimneko.de',
+        'nitter.alefvanoon.xyz',
+        'n.hyperborea.cloud',
+        'twitter.mstdn.social',
+        'nitter.silkky.cloud',
+        'nttr.stream',
+        'fuckthesacklers.network',
+        'nitter.govt.land',
+        'nitter.datatunnel.xyz',
+        'de.nttr.stream',
+        'twtr.bch.bar',
+        'nitter.exonip.de',
+        'nitter.mastodon.pro',
+        'nitter.notraxx.ch',
+        'nitter.skrep.in',
+        'nitter.snopyta.org',
     )
 
     INSTANCES = NON_HTTP_INSTANCES + HTTP_INSTANCES + DEAD_INSTANCES
@@ -202,6 +265,26 @@ class NitterIE(InfoExtractor):
                 'repost_count': int,
                 'comment_count': int,
             }
+        }, {  # no OpenGraph title
+            'url': f'https://{current_instance}/LocalBateman/status/1678455464038735895#m',
+            'info_dict': {
+                'id': '1678455464038735895',
+                'ext': 'mp4',
+                'title': 'Your Typical Local Man - Local man, what did Romanians ever do to you?',
+                'description': 'Local man, what did Romanians ever do to you?',
+                'thumbnail': r're:^https?://.*\.jpg$',
+                'uploader': 'Your Typical Local Man',
+                'uploader_id': 'LocalBateman',
+                'uploader_url': f'https://{current_instance}/LocalBateman',
+                'upload_date': '20230710',
+                'timestamp': 1689009900,
+                'view_count': int,
+                'like_count': int,
+                'repost_count': int,
+                'comment_count': int,
+            },
+            'expected_warnings': ['Ignoring subtitle tracks found in the HLS manifest'],
+            'params': {'skip_download': 'm3u8'},
         }
     ]
 
@@ -229,7 +312,7 @@ def _real_extract(self, url):
                 'ext': ext
             }]
 
-        title = description = self._og_search_description(full_webpage) or self._html_search_regex(
+        title = description = self._og_search_description(full_webpage, default=None) or self._html_search_regex(
             r'<div class="tweet-content[^>]+>([^<]+)</div>', webpage, 'title', fatal=False)
 
         uploader_id = self._html_search_regex(