[extractor] Document netrc machines

Closes #3169
pull/3719/head
pukkandan 2 years ago
parent 494f52308b
commit 8dcce6a89c
No known key found for this signature in database
GPG Key ID: 7EEE9E1E817D0A39

@ -5,38 +5,19 @@ import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import yt_dlp from yt_dlp.extractor import list_extractors
def main(): def main():
parser = optparse.OptionParser(usage='%prog OUTFILE.md') parser = optparse.OptionParser(usage='%prog OUTFILE.md')
options, args = parser.parse_args() _, args = parser.parse_args()
if len(args) != 1: if len(args) != 1:
parser.error('Expected an output filename') parser.error('Expected an output filename')
outfile, = args out = '\n'.join(ie.description() for ie in list_extractors(None) if ie.IE_DESC is not False)
def gen_ies_md(ies): with open(args[0], 'w', encoding='utf-8') as outf:
for ie in ies: outf.write(f'# Supported sites\n{out}\n')
ie_md = f'**{ie.IE_NAME}**'
if ie.IE_DESC is False:
continue
if ie.IE_DESC is not None:
ie_md += f': {ie.IE_DESC}'
search_key = getattr(ie, 'SEARCH_KEY', None)
if search_key is not None:
ie_md += f'; "{ie.SEARCH_KEY}:" prefix'
if not ie.working():
ie_md += ' (Currently broken)'
yield ie_md
ies = sorted(yt_dlp.gen_extractors(), key=lambda i: i.IE_NAME.lower())
out = '# Supported sites\n' + ''.join(
' - ' + md + '\n'
for md in gen_ies_md(ies))
with open(outfile, 'w', encoding='utf-8') as outf:
outf.write(out)
if __name__ == '__main__': if __name__ == '__main__':

@ -24,12 +24,12 @@
- **abcnews:video** - **abcnews:video**
- **abcotvs**: ABC Owned Television Stations - **abcotvs**: ABC Owned Television Stations
- **abcotvs:clips** - **abcotvs:clips**
- **AbemaTV** - **AbemaTV**: [<abbr title="netrc machine"><em>abematv</em></abbr>]
- **AbemaTVTitle** - **AbemaTVTitle**
- **AcademicEarth:Course** - **AcademicEarth:Course**
- **acast** - **acast**
- **acast:channel** - **acast:channel**
- **ADN**: Anime Digital Network - **ADN**: [<abbr title="netrc machine"><em>animedigitalnetwork</em></abbr>] Anime Digital Network
- **AdobeConnect** - **AdobeConnect**
- **adobetv** - **adobetv**
- **adobetv:channel** - **adobetv:channel**
@ -40,8 +40,8 @@
- **aenetworks**: A+E Networks: A&E, Lifetime, History.com, FYI Network and History Vault - **aenetworks**: A+E Networks: A&E, Lifetime, History.com, FYI Network and History Vault
- **aenetworks:collection** - **aenetworks:collection**
- **aenetworks:show** - **aenetworks:show**
- **afreecatv**: afreecatv.com - **afreecatv**: [<abbr title="netrc machine"><em>afreecatv</em></abbr>] afreecatv.com
- **afreecatv:live**: afreecatv.com - **afreecatv:live**: [<abbr title="netrc machine"><em>afreecatv</em></abbr>] afreecatv.com
- **afreecatv:user** - **afreecatv:user**
- **AirMozilla** - **AirMozilla**
- **AliExpressLive** - **AliExpressLive**
@ -50,8 +50,8 @@
- **AlphaPorno** - **AlphaPorno**
- **Alsace20TV** - **Alsace20TV**
- **Alsace20TVEmbed** - **Alsace20TVEmbed**
- **Alura** - **Alura**: [<abbr title="netrc machine"><em>alura</em></abbr>]
- **AluraCourse** - **AluraCourse**: [<abbr title="netrc machine"><em>aluracourse</em></abbr>]
- **Amara** - **Amara**
- **AmazonStore** - **AmazonStore**
- **AMCNetworks** - **AMCNetworks**
@ -60,9 +60,9 @@
- **AmHistoryChannel** - **AmHistoryChannel**
- **anderetijden**: npo.nl, ntr.nl, omroepwnl.nl, zapp.nl and npo3.nl - **anderetijden**: npo.nl, ntr.nl, omroepwnl.nl, zapp.nl and npo3.nl
- **AnimalPlanet** - **AnimalPlanet**
- **AnimeLab** - **AnimeLab**: [<abbr title="netrc machine"><em>animelab</em></abbr>]
- **AnimeLabShows** - **AnimeLabShows**: [<abbr title="netrc machine"><em>animelab</em></abbr>]
- **AnimeOnDemand** - **AnimeOnDemand**: [<abbr title="netrc machine"><em>animeondemand</em></abbr>]
- **ant1newsgr:article**: ant1news.gr articles - **ant1newsgr:article**: ant1news.gr articles
- **ant1newsgr:embed**: ant1news.gr embedded videos - **ant1newsgr:embed**: ant1news.gr embedded videos
- **ant1newsgr:watch**: ant1news.gr videos - **ant1newsgr:watch**: ant1news.gr videos
@ -88,7 +88,7 @@
- **ArteTVPlaylist** - **ArteTVPlaylist**
- **AsianCrush** - **AsianCrush**
- **AsianCrushPlaylist** - **AsianCrushPlaylist**
- **AtresPlayer** - **AtresPlayer**: [<abbr title="netrc machine"><em>atresplayer</em></abbr>]
- **ATTTechChannel** - **ATTTechChannel**
- **ATVAt** - **ATVAt**
- **AudiMedia** - **AudiMedia**
@ -114,13 +114,13 @@
- **Bandcamp:weekly** - **Bandcamp:weekly**
- **bangumi.bilibili.com**: BiliBili番剧 - **bangumi.bilibili.com**: BiliBili番剧
- **BannedVideo** - **BannedVideo**
- **bbc**: BBC - **bbc**: [<abbr title="netrc machine"><em>bbc</em></abbr>] BBC
- **bbc.co.uk**: BBC iPlayer - **bbc.co.uk**: [<abbr title="netrc machine"><em>bbc</em></abbr>] BBC iPlayer
- **bbc.co.uk:article**: BBC articles - **bbc.co.uk:article**: BBC articles
- **bbc.co.uk:iplayer:episodes** - **bbc.co.uk:iplayer:episodes**
- **bbc.co.uk:iplayer:group** - **bbc.co.uk:iplayer:group**
- **bbc.co.uk:playlist** - **bbc.co.uk:playlist**
- **BBVTV** - **BBVTV**: [<abbr title="netrc machine"><em>bbvtv</em></abbr>]
- **Beatport** - **Beatport**
- **Beeg** - **Beeg**
- **BehindKink** - **BehindKink**
@ -142,8 +142,9 @@
- **BilibiliChannel** - **BilibiliChannel**
- **BiliBiliPlayer** - **BiliBiliPlayer**
- **BiliBiliSearch**: Bilibili video search; "bilisearch:" prefix - **BiliBiliSearch**: Bilibili video search; "bilisearch:" prefix
- **BiliIntl** - **BiliIntl**: [<abbr title="netrc machine"><em>biliintl</em></abbr>]
- **BiliIntlSeries** - **BiliIntlSeries**: [<abbr title="netrc machine"><em>biliintl</em></abbr>]
- **BiliLive**
- **BioBioChileTV** - **BioBioChileTV**
- **Biography** - **Biography**
- **BIQLE** - **BIQLE**
@ -252,10 +253,10 @@
- **CrooksAndLiars** - **CrooksAndLiars**
- **CrowdBunker** - **CrowdBunker**
- **CrowdBunkerChannel** - **CrowdBunkerChannel**
- **crunchyroll** - **crunchyroll**: [<abbr title="netrc machine"><em>crunchyroll</em></abbr>]
- **crunchyroll:beta** - **crunchyroll:beta**: [<abbr title="netrc machine"><em>crunchyroll</em></abbr>]
- **crunchyroll:playlist** - **crunchyroll:playlist**: [<abbr title="netrc machine"><em>crunchyroll</em></abbr>]
- **crunchyroll:playlist:beta** - **crunchyroll:playlist:beta**: [<abbr title="netrc machine"><em>crunchyroll</em></abbr>]
- **CSpan**: C-SPAN - **CSpan**: C-SPAN
- **CSpanCongress** - **CSpanCongress**
- **CtsNews**: 華視新聞 - **CtsNews**: 華視新聞
@ -263,18 +264,18 @@
- **CTVNews** - **CTVNews**
- **cu.ntv.co.jp**: Nippon Television Network - **cu.ntv.co.jp**: Nippon Television Network
- **CultureUnplugged** - **CultureUnplugged**
- **curiositystream** - **curiositystream**: [<abbr title="netrc machine"><em>curiositystream</em></abbr>]
- **curiositystream:collections** - **curiositystream:collections**: [<abbr title="netrc machine"><em>curiositystream</em></abbr>]
- **curiositystream:series** - **curiositystream:series**: [<abbr title="netrc machine"><em>curiositystream</em></abbr>]
- **CWTV** - **CWTV**
- **Cybrary** - **Cybrary**: [<abbr title="netrc machine"><em>cybrary</em></abbr>]
- **CybraryCourse** - **CybraryCourse**: [<abbr title="netrc machine"><em>cybrary</em></abbr>]
- **Daftsex** - **Daftsex**
- **DagelijkseKost**: dagelijksekost.een.be - **DagelijkseKost**: dagelijksekost.een.be
- **DailyMail** - **DailyMail**
- **dailymotion** - **dailymotion**: [<abbr title="netrc machine"><em>dailymotion</em></abbr>]
- **dailymotion:playlist** - **dailymotion:playlist**: [<abbr title="netrc machine"><em>dailymotion</em></abbr>]
- **dailymotion:user** - **dailymotion:user**: [<abbr title="netrc machine"><em>dailymotion</em></abbr>]
- **damtomo:record** - **damtomo:record**
- **damtomo:video** - **damtomo:video**
- **daum.net** - **daum.net**
@ -291,7 +292,7 @@
- **DestinationAmerica** - **DestinationAmerica**
- **DHM**: Filmarchiv - Deutsches Historisches Museum - **DHM**: Filmarchiv - Deutsches Historisches Museum
- **Digg** - **Digg**
- **DigitalConcertHall**: DigitalConcertHall extractor - **DigitalConcertHall**: [<abbr title="netrc machine"><em>digitalconcerthall</em></abbr>] DigitalConcertHall extractor
- **DigitallySpeaking** - **DigitallySpeaking**
- **Digiteka** - **Digiteka**
- **Discovery** - **Discovery**
@ -315,7 +316,7 @@
- **DRBonanza** - **DRBonanza**
- **Drooble** - **Drooble**
- **Dropbox** - **Dropbox**
- **Dropout** - **Dropout**: [<abbr title="netrc machine"><em>dropout</em></abbr>]
- **DropoutSeason** - **DropoutSeason**
- **DrTuber** - **DrTuber**
- **drtv** - **drtv**
@ -334,7 +335,7 @@
- **egghead:lesson**: egghead.io lesson - **egghead:lesson**: egghead.io lesson
- **ehftv** - **ehftv**
- **eHow** - **eHow**
- **EinsUndEinsTV** - **EinsUndEinsTV**: [<abbr title="netrc machine"><em>1und1tv</em></abbr>]
- **Einthusan** - **Einthusan**
- **eitb.tv** - **eitb.tv**
- **EllenTube** - **EllenTube**
@ -348,7 +349,7 @@
- **Epicon** - **Epicon**
- **EpiconSeries** - **EpiconSeries**
- **Eporner** - **Eporner**
- **EroProfile** - **EroProfile**: [<abbr title="netrc machine"><em>eroprofile</em></abbr>]
- **EroProfile:album** - **EroProfile:album**
- **ertflix**: ERTFLIX videos - **ertflix**: ERTFLIX videos
- **ertflix:codename**: ERTFLIX videos by codename - **ertflix:codename**: ERTFLIX videos by codename
@ -361,17 +362,17 @@
- **Europa** - **Europa**
- **EuropeanTour** - **EuropeanTour**
- **EUScreen** - **EUScreen**
- **EWETV** - **EWETV**: [<abbr title="netrc machine"><em>ewetv</em></abbr>]
- **ExpoTV** - **ExpoTV**
- **Expressen** - **Expressen**
- **ExtremeTube** - **ExtremeTube**
- **EyedoTV** - **EyedoTV**
- **facebook** - **facebook**: [<abbr title="netrc machine"><em>facebook</em></abbr>]
- **FacebookPluginsVideo** - **FacebookPluginsVideo**
- **fancode:live** - **fancode:live**: [<abbr title="netrc machine"><em>fancode</em></abbr>]
- **fancode:vod** - **fancode:vod**: [<abbr title="netrc machine"><em>fancode</em></abbr>]
- **faz.net** - **faz.net**
- **fc2** - **fc2**: [<abbr title="netrc machine"><em>fc2</em></abbr>]
- **fc2:embed** - **fc2:embed**
- **fc2:live** - **fc2:live**
- **Fczenit** - **Fczenit**
@ -401,19 +402,19 @@
- **FranceTVSite** - **FranceTVSite**
- **Freesound** - **Freesound**
- **freespeech.org** - **freespeech.org**
- **FrontendMasters** - **FrontendMasters**: [<abbr title="netrc machine"><em>frontendmasters</em></abbr>]
- **FrontendMastersCourse** - **FrontendMastersCourse**: [<abbr title="netrc machine"><em>frontendmasters</em></abbr>]
- **FrontendMastersLesson** - **FrontendMastersLesson**: [<abbr title="netrc machine"><em>frontendmasters</em></abbr>]
- **FujiTVFODPlus7** - **FujiTVFODPlus7**
- **Funimation** - **Funimation**: [<abbr title="netrc machine"><em>funimation</em></abbr>]
- **funimation:page** - **funimation:page**: [<abbr title="netrc machine"><em>funimation</em></abbr>]
- **funimation:show** - **funimation:show**: [<abbr title="netrc machine"><em>funimation</em></abbr>]
- **Funk** - **Funk**
- **Fusion** - **Fusion**
- **Fux** - **Fux**
- **Gab** - **Gab**
- **GabTV** - **GabTV**
- **Gaia** - **Gaia**: [<abbr title="netrc machine"><em>gaia</em></abbr>]
- **GameInformer** - **GameInformer**
- **GameJolt** - **GameJolt**
- **GameJoltCommunity** - **GameJoltCommunity**
@ -425,9 +426,9 @@
- **GameStar** - **GameStar**
- **Gaskrank** - **Gaskrank**
- **Gazeta** - **Gazeta**
- **GDCVault** - **GDCVault**: [<abbr title="netrc machine"><em>gdcvault</em></abbr>]
- **GediDigital** - **GediDigital**
- **gem.cbc.ca** - **gem.cbc.ca**: [<abbr title="netrc machine"><em>cbcgem</em></abbr>]
- **gem.cbc.ca:live** - **gem.cbc.ca:live**
- **gem.cbc.ca:playlist** - **gem.cbc.ca:playlist**
- **generic**: Generic downloader that works on some sites - **generic**: Generic downloader that works on some sites
@ -436,9 +437,9 @@
- **Gfycat** - **Gfycat**
- **GiantBomb** - **GiantBomb**
- **Giga** - **Giga**
- **GlattvisionTV** - **GlattvisionTV**: [<abbr title="netrc machine"><em>glattvisiontv</em></abbr>]
- **Glide**: Glide mobile video messages (glide.me) - **Glide**: Glide mobile video messages (glide.me)
- **Globo** - **Globo**: [<abbr title="netrc machine"><em>globo</em></abbr>]
- **GloboArticle** - **GloboArticle**
- **glomex**: Glomex videos - **glomex**: Glomex videos
- **glomex:embed**: Glomex embedded videos - **glomex:embed**: Glomex embedded videos
@ -466,7 +467,7 @@
- **hgtv.com:show** - **hgtv.com:show**
- **HGTVDe** - **HGTVDe**
- **HGTVUsa** - **HGTVUsa**
- **HiDive** - **HiDive**: [<abbr title="netrc machine"><em>hidive</em></abbr>]
- **HistoricFilms** - **HistoricFilms**
- **history:player** - **history:player**
- **history:topic**: History.com Topic - **history:topic**: History.com Topic
@ -481,8 +482,8 @@
- **Howcast** - **Howcast**
- **HowStuffWorks** - **HowStuffWorks**
- **hrfernsehen** - **hrfernsehen**
- **HRTi** - **HRTi**: [<abbr title="netrc machine"><em>hrti</em></abbr>]
- **HRTiPlaylist** - **HRTiPlaylist**: [<abbr title="netrc machine"><em>hrti</em></abbr>]
- **HSEProduct** - **HSEProduct**
- **HSEShow** - **HSEShow**
- **Huajiao**: 花椒直播 - **Huajiao**: 花椒直播
@ -506,19 +507,19 @@
- **Inc** - **Inc**
- **IndavideoEmbed** - **IndavideoEmbed**
- **InfoQ** - **InfoQ**
- **Instagram** - **Instagram**: [<abbr title="netrc machine"><em>instagram</em></abbr>]
- **instagram:story** - **instagram:story**: [<abbr title="netrc machine"><em>instagram</em></abbr>]
- **instagram:tag**: Instagram hashtag search URLs - **instagram:tag**: [<abbr title="netrc machine"><em>instagram</em></abbr>] Instagram hashtag search URLs
- **instagram:user**: Instagram user profile - **instagram:user**: [<abbr title="netrc machine"><em>instagram</em></abbr>] Instagram user profile
- **InstagramIOS**: IOS instagram:// URL - **InstagramIOS**: IOS instagram:// URL
- **Internazionale** - **Internazionale**
- **InternetVideoArchive** - **InternetVideoArchive**
- **InvestigationDiscovery** - **InvestigationDiscovery**
- **IPrima** - **IPrima**: [<abbr title="netrc machine"><em>iprima</em></abbr>]
- **IPrimaCNN** - **IPrimaCNN**
- **iq.com**: International version of iQiyi - **iq.com**: International version of iQiyi
- **iq.com:album** - **iq.com:album**
- **iqiyi**: 爱奇艺 - **iqiyi**: [<abbr title="netrc machine"><em>iqiyi</em></abbr>] 爱奇艺
- **ITProTV** - **ITProTV**
- **ITProTVCourse** - **ITProTVCourse**
- **ITTF** - **ITTF**
@ -576,9 +577,9 @@
- **LcpPlay** - **LcpPlay**
- **Le**: 乐视网 - **Le**: 乐视网
- **Lecture2Go** - **Lecture2Go**
- **Lecturio** - **Lecturio**: [<abbr title="netrc machine"><em>lecturio</em></abbr>]
- **LecturioCourse** - **LecturioCourse**: [<abbr title="netrc machine"><em>lecturio</em></abbr>]
- **LecturioDeCourse** - **LecturioDeCourse**: [<abbr title="netrc machine"><em>lecturio</em></abbr>]
- **LEGO** - **LEGO**
- **Lemonde** - **Lemonde**
- **Lenta** - **Lenta**
@ -592,10 +593,10 @@
- **limelight:channel_list** - **limelight:channel_list**
- **LineLive** - **LineLive**
- **LineLiveChannel** - **LineLiveChannel**
- **LinkedIn** - **LinkedIn**: [<abbr title="netrc machine"><em>linkedin</em></abbr>]
- **linkedin:learning** - **linkedin:learning**: [<abbr title="netrc machine"><em>linkedin</em></abbr>]
- **linkedin:learning:course** - **linkedin:learning:course**: [<abbr title="netrc machine"><em>linkedin</em></abbr>]
- **LinuxAcademy** - **LinuxAcademy**: [<abbr title="netrc machine"><em>linuxacademy</em></abbr>]
- **LiTV** - **LiTV**
- **LiveJournal** - **LiveJournal**
- **livestream** - **livestream**
@ -606,8 +607,8 @@
- **LocalNews8** - **LocalNews8**
- **LoveHomePorn** - **LoveHomePorn**
- **lrt.lt** - **lrt.lt**
- **lynda**: lynda.com videos - **lynda**: [<abbr title="netrc machine"><em>lynda</em></abbr>] lynda.com videos
- **lynda:course**: lynda.com online courses - **lynda:course**: [<abbr title="netrc machine"><em>lynda</em></abbr>] lynda.com online courses
- **m6** - **m6**
- **MagentaMusik360** - **MagentaMusik360**
- **mailru**: Видео@Mail.Ru - **mailru**: Видео@Mail.Ru
@ -674,7 +675,7 @@
- **MLBVideo** - **MLBVideo**
- **MLSSoccer** - **MLSSoccer**
- **Mnet** - **Mnet**
- **MNetTV** - **MNetTV**: [<abbr title="netrc machine"><em>mnettv</em></abbr>]
- **MoeVideo**: LetitBit video services: moevideo.net, playreplay.net and videochart.net - **MoeVideo**: LetitBit video services: moevideo.net, playreplay.net and videochart.net
- **Mofosex** - **Mofosex**
- **MofosexEmbed** - **MofosexEmbed**
@ -746,8 +747,8 @@
- **ndr:embed** - **ndr:embed**
- **ndr:embed:base** - **ndr:embed:base**
- **NDTV** - **NDTV**
- **Nebula** - **Nebula**: [<abbr title="netrc machine"><em>watchnebula</em></abbr>]
- **nebula:collection** - **nebula:collection**: [<abbr title="netrc machine"><em>watchnebula</em></abbr>]
- **NerdCubedFeed** - **NerdCubedFeed**
- **netease:album**: 网易云音乐 - 专辑 - **netease:album**: 网易云音乐 - 专辑
- **netease:djradio**: 网易云音乐 - 电台 - **netease:djradio**: 网易云音乐 - 电台
@ -756,7 +757,7 @@
- **netease:program**: 网易云音乐 - 电台节目 - **netease:program**: 网易云音乐 - 电台节目
- **netease:singer**: 网易云音乐 - 歌手 - **netease:singer**: 网易云音乐 - 歌手
- **netease:song**: 网易云音乐 - **netease:song**: 网易云音乐
- **NetPlus** - **NetPlus**: [<abbr title="netrc machine"><em>netplus</em></abbr>]
- **Netzkino** - **Netzkino**
- **Newgrounds** - **Newgrounds**
- **Newgrounds:playlist** - **Newgrounds:playlist**
@ -770,8 +771,8 @@
- **NexxEmbed** - **NexxEmbed**
- **NFB** - **NFB**
- **NFHSNetwork** - **NFHSNetwork**
- **nfl.com** (Currently broken) - **nfl.com**: (**Currently broken**)
- **nfl.com:article** (Currently broken) - **nfl.com:article**: (**Currently broken**)
- **NhkForSchoolBangumi** - **NhkForSchoolBangumi**
- **NhkForSchoolProgramList** - **NhkForSchoolProgramList**
- **NhkForSchoolSubject**: Portal page for each school subjects, like Japanese (kokugo, 国語) or math (sansuu/suugaku or 算数・数学) - **NhkForSchoolSubject**: Portal page for each school subjects, like Japanese (kokugo, 国語) or math (sansuu/suugaku or 算数・数学)
@ -783,7 +784,7 @@
- **nickelodeon:br** - **nickelodeon:br**
- **nickelodeonru** - **nickelodeonru**
- **nicknight** - **nicknight**
- **niconico**: ニコニコ動画 - **niconico**: [<abbr title="netrc machine"><em>niconico</em></abbr>] ニコニコ動画
- **niconico:history**: NicoNico user history. Requires cookies. - **niconico:history**: NicoNico user history. Requires cookies.
- **niconico:playlist** - **niconico:playlist**
- **niconico:series** - **niconico:series**
@ -796,7 +797,7 @@
- **Nitter** - **Nitter**
- **njoy**: N-JOY - **njoy**: N-JOY
- **njoy:embed** - **njoy:embed**
- **NJPWWorld**: 新日本プロレスワールド - **NJPWWorld**: [<abbr title="netrc machine"><em>njpwworld</em></abbr>] 新日本プロレスワールド
- **NobelPrize** - **NobelPrize**
- **NonkTube** - **NonkTube**
- **NoodleMagazine** - **NoodleMagazine**
@ -869,9 +870,9 @@
- **orf:tvthek**: ORF TVthek - **orf:tvthek**: ORF TVthek
- **orf:vorarlberg**: Radio Vorarlberg - **orf:vorarlberg**: Radio Vorarlberg
- **orf:wien**: Radio Wien - **orf:wien**: Radio Wien
- **OsnatelTV** - **OsnatelTV**: [<abbr title="netrc machine"><em>osnateltv</em></abbr>]
- **OutsideTV** - **OutsideTV**
- **PacktPub** - **PacktPub**: [<abbr title="netrc machine"><em>packtpub</em></abbr>]
- **PacktPubCourse** - **PacktPubCourse**
- **PalcoMP3:artist** - **PalcoMP3:artist**
- **PalcoMP3:song** - **PalcoMP3:song**
@ -893,7 +894,7 @@
- **peer.tv** - **peer.tv**
- **PeerTube** - **PeerTube**
- **PeerTube:Playlist** - **PeerTube:Playlist**
- **peloton** - **peloton**: [<abbr title="netrc machine"><em>peloton</em></abbr>]
- **peloton:live**: Peloton Live - **peloton:live**: Peloton Live
- **People** - **People**
- **PerformGroup** - **PerformGroup**
@ -902,7 +903,7 @@
- **PhilharmonieDeParis**: Philharmonie de Paris - **PhilharmonieDeParis**: Philharmonie de Paris
- **phoenix.de** - **phoenix.de**
- **Photobucket** - **Photobucket**
- **Piapro** - **Piapro**: [<abbr title="netrc machine"><em>piapro</em></abbr>]
- **Picarto** - **Picarto**
- **PicartoVod** - **PicartoVod**
- **Piksel** - **Piksel**
@ -913,26 +914,26 @@
- **pixiv:sketch:user** - **pixiv:sketch:user**
- **Pladform** - **Pladform**
- **PlanetMarathi** - **PlanetMarathi**
- **Platzi** - **Platzi**: [<abbr title="netrc machine"><em>platzi</em></abbr>]
- **PlatziCourse** - **PlatziCourse**: [<abbr title="netrc machine"><em>platzi</em></abbr>]
- **play.fm** - **play.fm**
- **player.sky.it** - **player.sky.it**
- **PlayPlusTV** - **PlayPlusTV**: [<abbr title="netrc machine"><em>playplustv</em></abbr>]
- **PlayStuff** - **PlayStuff**
- **PlaysTV** - **PlaysTV**
- **Playtvak**: Playtvak.cz, iDNES.cz and Lidovky.cz - **Playtvak**: Playtvak.cz, iDNES.cz and Lidovky.cz
- **Playvid** - **Playvid**
- **PlayVids** - **PlayVids**
- **Playwire** - **Playwire**
- **pluralsight** - **pluralsight**: [<abbr title="netrc machine"><em>pluralsight</em></abbr>]
- **pluralsight:course** - **pluralsight:course**
- **PlutoTV** - **PlutoTV**
- **podomatic** - **podomatic**
- **Pokemon** - **Pokemon**
- **PokemonSoundLibrary** - **PokemonSoundLibrary**
- **PokemonWatch** - **PokemonWatch**
- **PokerGo** - **PokerGo**: [<abbr title="netrc machine"><em>pokergo</em></abbr>]
- **PokerGoCollection** - **PokerGoCollection**: [<abbr title="netrc machine"><em>pokergo</em></abbr>]
- **PolsatGo** - **PolsatGo**
- **PolskieRadio** - **PolskieRadio**
- **polskieradio:kierowcow** - **polskieradio:kierowcow**
@ -947,11 +948,11 @@
- **Pornez** - **Pornez**
- **PornFlip** - **PornFlip**
- **PornHd** - **PornHd**
- **PornHub**: PornHub and Thumbzilla - **PornHub**: [<abbr title="netrc machine"><em>pornhub</em></abbr>] PornHub and Thumbzilla
- **PornHubPagedVideoList** - **PornHubPagedVideoList**: [<abbr title="netrc machine"><em>pornhub</em></abbr>]
- **PornHubPlaylist** - **PornHubPlaylist**: [<abbr title="netrc machine"><em>pornhub</em></abbr>]
- **PornHubUser** - **PornHubUser**: [<abbr title="netrc machine"><em>pornhub</em></abbr>]
- **PornHubUserVideosUpload** - **PornHubUserVideosUpload**: [<abbr title="netrc machine"><em>pornhub</em></abbr>]
- **Pornotube** - **Pornotube**
- **PornoVoisines** - **PornoVoisines**
- **PornoXO** - **PornoXO**
@ -973,7 +974,7 @@
- **qqmusic:playlist**: QQ音乐 - 歌单 - **qqmusic:playlist**: QQ音乐 - 歌单
- **qqmusic:singer**: QQ音乐 - 歌手 - **qqmusic:singer**: QQ音乐 - 歌手
- **qqmusic:toplist**: QQ音乐 - 排行榜 - **qqmusic:toplist**: QQ音乐 - 排行榜
- **QuantumTV** - **QuantumTV**: [<abbr title="netrc machine"><em>quantumtv</em></abbr>]
- **Qub** - **Qub**
- **R7** - **R7**
- **R7Article** - **R7Article**
@ -1029,8 +1030,8 @@
- **Rokfin** - **Rokfin**
- **rokfin:channel** - **rokfin:channel**
- **rokfin:stack** - **rokfin:stack**
- **RoosterTeeth** - **RoosterTeeth**: [<abbr title="netrc machine"><em>roosterteeth</em></abbr>]
- **RoosterTeethSeries** - **RoosterTeethSeries**: [<abbr title="netrc machine"><em>roosterteeth</em></abbr>]
- **RottenTomatoes** - **RottenTomatoes**
- **Rozhlas** - **Rozhlas**
- **RTBF** - **RTBF**
@ -1069,12 +1070,12 @@
- **Ruutu** - **Ruutu**
- **Ruv** - **Ruv**
- **ruv.is:spila** - **ruv.is:spila**
- **safari**: safaribooksonline.com online video - **safari**: [<abbr title="netrc machine"><em>safari</em></abbr>] safaribooksonline.com online video
- **safari:api** - **safari:api**: [<abbr title="netrc machine"><em>safari</em></abbr>]
- **safari:course**: safaribooksonline.com online courses - **safari:course**: [<abbr title="netrc machine"><em>safari</em></abbr>] safaribooksonline.com online courses
- **Saitosan** - **Saitosan**
- **SAKTV** - **SAKTV**: [<abbr title="netrc machine"><em>saktv</em></abbr>]
- **SaltTV** - **SaltTV**: [<abbr title="netrc machine"><em>salttv</em></abbr>]
- **SampleFocus** - **SampleFocus**
- **Sapo**: SAPO Vídeos - **Sapo**: SAPO Vídeos
- **savefrom.net** - **savefrom.net**
@ -1086,8 +1087,8 @@
- **ScreencastOMatic** - **ScreencastOMatic**
- **ScrippsNetworks** - **ScrippsNetworks**
- **scrippsnetworks:watch** - **scrippsnetworks:watch**
- **SCTE** - **SCTE**: [<abbr title="netrc machine"><em>scte</em></abbr>]
- **SCTECourse** - **SCTECourse**: [<abbr title="netrc machine"><em>scte</em></abbr>]
- **Seeker** - **Seeker**
- **SenateGov** - **SenateGov**
- **SenateISVP** - **SenateISVP**
@ -1096,7 +1097,7 @@
- **Sexu** - **Sexu**
- **SeznamZpravy** - **SeznamZpravy**
- **SeznamZpravyArticle** - **SeznamZpravyArticle**
- **Shahid** - **Shahid**: [<abbr title="netrc machine"><em>shahid</em></abbr>]
- **ShahidShow** - **ShahidShow**
- **Shared**: shared.sx - **Shared**: shared.sx
- **ShemarooMe** - **ShemarooMe**
@ -1121,15 +1122,15 @@
- **Slutload** - **Slutload**
- **Snotr** - **Snotr**
- **Sohu** - **Sohu**
- **SonyLIV** - **SonyLIV**: [<abbr title="netrc machine"><em>sonyliv</em></abbr>]
- **SonyLIVSeries** - **SonyLIVSeries**
- **soundcloud** - **soundcloud**: [<abbr title="netrc machine"><em>soundcloud</em></abbr>]
- **soundcloud:playlist** - **soundcloud:playlist**: [<abbr title="netrc machine"><em>soundcloud</em></abbr>]
- **soundcloud:related** - **soundcloud:related**: [<abbr title="netrc machine"><em>soundcloud</em></abbr>]
- **soundcloud:search**: Soundcloud search; "scsearch:" prefix - **soundcloud:search**: [<abbr title="netrc machine"><em>soundcloud</em></abbr>] Soundcloud search; "scsearch:" prefix
- **soundcloud:set** - **soundcloud:set**: [<abbr title="netrc machine"><em>soundcloud</em></abbr>]
- **soundcloud:trackstation** - **soundcloud:trackstation**: [<abbr title="netrc machine"><em>soundcloud</em></abbr>]
- **soundcloud:user** - **soundcloud:user**: [<abbr title="netrc machine"><em>soundcloud</em></abbr>]
- **SoundcloudEmbed** - **SoundcloudEmbed**
- **soundgasm** - **soundgasm**
- **soundgasm:profile** - **soundgasm:profile**
@ -1190,13 +1191,13 @@
- **Tass** - **Tass**
- **TBS** - **TBS**
- **TDSLifeway** - **TDSLifeway**
- **Teachable** - **Teachable**: [<abbr title="netrc machine"><em>teachable</em></abbr>]
- **TeachableCourse** - **TeachableCourse**: [<abbr title="netrc machine"><em>teachable</em></abbr>]
- **teachertube**: teachertube.com videos - **teachertube**: teachertube.com videos
- **teachertube:user:collection**: teachertube.com user and collection videos - **teachertube:user:collection**: teachertube.com user and collection videos
- **TeachingChannel** - **TeachingChannel**
- **Teamcoco** - **Teamcoco**
- **TeamTreeHouse** - **TeamTreeHouse**: [<abbr title="netrc machine"><em>teamtreehouse</em></abbr>]
- **TechTalks** - **TechTalks**
- **techtv.mit.edu** - **techtv.mit.edu**
- **TedEmbed** - **TedEmbed**
@ -1218,8 +1219,8 @@
- **TeleQuebecVideo** - **TeleQuebecVideo**
- **TeleTask** - **TeleTask**
- **Telewebion** - **Telewebion**
- **TennisTV** - **TennisTV**: [<abbr title="netrc machine"><em>tennistv</em></abbr>]
- **TenPlay** - **TenPlay**: [<abbr title="netrc machine"><em>10play</em></abbr>]
- **TF1** - **TF1**
- **TFO** - **TFO**
- **TheIntercept** - **TheIntercept**
@ -1250,10 +1251,10 @@
- **Tokentube** - **Tokentube**
- **Tokentube:channel** - **Tokentube:channel**
- **ToonGoggles** - **ToonGoggles**
- **tou.tv** - **tou.tv**: [<abbr title="netrc machine"><em>toutv</em></abbr>]
- **Toypics**: Toypics video - **Toypics**: Toypics video
- **ToypicsUser**: Toypics user profile - **ToypicsUser**: Toypics user profile
- **TrailerAddict** (Currently broken) - **TrailerAddict**: (**Currently broken**)
- **TravelChannel** - **TravelChannel**
- **Trilulilu** - **Trilulilu**
- **Trovo** - **Trovo**
@ -1264,9 +1265,9 @@
- **TruNews** - **TruNews**
- **TruTV** - **TruTV**
- **Tube8** - **Tube8**
- **TubiTv** - **TubiTv**: [<abbr title="netrc machine"><em>tubitv</em></abbr>]
- **TubiTvShow** - **TubiTvShow**
- **Tumblr** - **Tumblr**: [<abbr title="netrc machine"><em>tumblr</em></abbr>]
- **tunein:clip** - **tunein:clip**
- **tunein:program** - **tunein:program**
- **tunein:station** - **tunein:station**
@ -1314,23 +1315,23 @@
- **TwitCasting** - **TwitCasting**
- **TwitCastingLive** - **TwitCastingLive**
- **TwitCastingUser** - **TwitCastingUser**
- **twitch:clips** - **twitch:clips**: [<abbr title="netrc machine"><em>twitch</em></abbr>]
- **twitch:stream** - **twitch:stream**: [<abbr title="netrc machine"><em>twitch</em></abbr>]
- **twitch:vod** - **twitch:vod**: [<abbr title="netrc machine"><em>twitch</em></abbr>]
- **TwitchCollection** - **TwitchCollection**: [<abbr title="netrc machine"><em>twitch</em></abbr>]
- **TwitchVideos** - **TwitchVideos**: [<abbr title="netrc machine"><em>twitch</em></abbr>]
- **TwitchVideosClips** - **TwitchVideosClips**: [<abbr title="netrc machine"><em>twitch</em></abbr>]
- **TwitchVideosCollections** - **TwitchVideosCollections**: [<abbr title="netrc machine"><em>twitch</em></abbr>]
- **twitter** - **twitter**
- **twitter:amplify** - **twitter:amplify**
- **twitter:broadcast** - **twitter:broadcast**
- **twitter:card** - **twitter:card**
- **twitter:shortener** - **twitter:shortener**
- **udemy** - **udemy**: [<abbr title="netrc machine"><em>udemy</em></abbr>]
- **udemy:course** - **udemy:course**: [<abbr title="netrc machine"><em>udemy</em></abbr>]
- **UDNEmbed**: 聯合影音 - **UDNEmbed**: 聯合影音
- **UFCArabia** - **UFCArabia**: [<abbr title="netrc machine"><em>ufcarabia</em></abbr>]
- **UFCTV** - **UFCTV**: [<abbr title="netrc machine"><em>ufctv</em></abbr>]
- **ukcolumn** - **ukcolumn**
- **UKTVPlay** - **UKTVPlay**
- **umg:de**: Universal Music Deutschland - **umg:de**: Universal Music Deutschland
@ -1358,7 +1359,7 @@
- **VevoPlaylist** - **VevoPlaylist**
- **VGTV**: VGTV, BTTV, FTV, Aftenposten and Aftonbladet - **VGTV**: VGTV, BTTV, FTV, Aftenposten and Aftonbladet
- **vh1.com** - **vh1.com**
- **vhx:embed** - **vhx:embed**: [<abbr title="netrc machine"><em>vimeo</em></abbr>]
- **Viafree** - **Viafree**
- **vice** - **vice**
- **vice:article** - **vice:article**
@ -1378,26 +1379,26 @@
- **videomore:season** - **videomore:season**
- **videomore:video** - **videomore:video**
- **VideoPress** - **VideoPress**
- **Vidio** - **Vidio**: [<abbr title="netrc machine"><em>vidio</em></abbr>]
- **VidioLive** - **VidioLive**: [<abbr title="netrc machine"><em>vidio</em></abbr>]
- **VidioPremier** - **VidioPremier**: [<abbr title="netrc machine"><em>vidio</em></abbr>]
- **VidLii** - **VidLii**
- **vier**: vier.be and vijf.be - **vier**: [<abbr title="netrc machine"><em>vier</em></abbr>] vier.be and vijf.be
- **vier:videos** - **vier:videos**
- **viewlift** - **viewlift**
- **viewlift:embed** - **viewlift:embed**
- **Viidea** - **Viidea**
- **viki** - **viki**: [<abbr title="netrc machine"><em>viki</em></abbr>]
- **viki:channel** - **viki:channel**: [<abbr title="netrc machine"><em>viki</em></abbr>]
- **vimeo** - **vimeo**: [<abbr title="netrc machine"><em>vimeo</em></abbr>]
- **vimeo:album** - **vimeo:album**: [<abbr title="netrc machine"><em>vimeo</em></abbr>]
- **vimeo:channel** - **vimeo:channel**: [<abbr title="netrc machine"><em>vimeo</em></abbr>]
- **vimeo:group** - **vimeo:group**: [<abbr title="netrc machine"><em>vimeo</em></abbr>]
- **vimeo:likes**: Vimeo user likes - **vimeo:likes**: [<abbr title="netrc machine"><em>vimeo</em></abbr>] Vimeo user likes
- **vimeo:ondemand** - **vimeo:ondemand**: [<abbr title="netrc machine"><em>vimeo</em></abbr>]
- **vimeo:review**: Review pages on vimeo - **vimeo:review**: [<abbr title="netrc machine"><em>vimeo</em></abbr>] Review pages on vimeo
- **vimeo:user** - **vimeo:user**: [<abbr title="netrc machine"><em>vimeo</em></abbr>]
- **vimeo:watchlater**: Vimeo watch later list, "vimeowatchlater" keyword (requires authentication) - **vimeo:watchlater**: [<abbr title="netrc machine"><em>vimeo</em></abbr>] Vimeo watch later list, ":vimeowatchlater" keyword (requires authentication)
- **Vimm:recording** - **Vimm:recording**
- **Vimm:stream** - **Vimm:stream**
- **Vimple**: Vimple - one-click video hosting - **Vimple**: Vimple - one-click video hosting
@ -1405,15 +1406,15 @@
- **vine:user** - **vine:user**
- **Viqeo** - **Viqeo**
- **Viu** - **Viu**
- **viu:ott** - **viu:ott**: [<abbr title="netrc machine"><em>viu</em></abbr>]
- **viu:playlist** - **viu:playlist**
- **Vivo**: vivo.sx - **Vivo**: vivo.sx
- **vk**: VK - **vk**: [<abbr title="netrc machine"><em>vk</em></abbr>] VK
- **vk:uservideos**: VK - User's Videos - **vk:uservideos**: [<abbr title="netrc machine"><em>vk</em></abbr>] VK - User's Videos
- **vk:wallpost** - **vk:wallpost**: [<abbr title="netrc machine"><em>vk</em></abbr>]
- **vlive** - **vlive**: [<abbr title="netrc machine"><em>vlive</em></abbr>]
- **vlive:channel** - **vlive:channel**: [<abbr title="netrc machine"><em>vlive</em></abbr>]
- **vlive:post** - **vlive:post**: [<abbr title="netrc machine"><em>vlive</em></abbr>]
- **vm.tiktok** - **vm.tiktok**
- **Vodlocker** - **Vodlocker**
- **VODPl** - **VODPl**
@ -1428,12 +1429,12 @@
- **vpro**: npo.nl, ntr.nl, omroepwnl.nl, zapp.nl and npo3.nl - **vpro**: npo.nl, ntr.nl, omroepwnl.nl, zapp.nl and npo3.nl
- **Vrak** - **Vrak**
- **VRT**: VRT NWS, Flanders News, Flandern Info and Sporza - **VRT**: VRT NWS, Flanders News, Flandern Info and Sporza
- **VrtNU**: VrtNU.be - **VrtNU**: [<abbr title="netrc machine"><em>vrtnu</em></abbr>] VrtNU.be
- **vrv** - **vrv**: [<abbr title="netrc machine"><em>vrv</em></abbr>]
- **vrv:series** - **vrv:series**
- **VShare** - **VShare**
- **VTM** - **VTM**
- **VTXTV** - **VTXTV**: [<abbr title="netrc machine"><em>vtxtv</em></abbr>]
- **VuClip** - **VuClip**
- **Vupload** - **Vupload**
- **VVVVID** - **VVVVID**
@ -1442,7 +1443,7 @@
- **Vzaar** - **Vzaar**
- **Wakanim** - **Wakanim**
- **Walla** - **Walla**
- **WalyTV** - **WalyTV**: [<abbr title="netrc machine"><em>walytv</em></abbr>]
- **wasdtv:clip** - **wasdtv:clip**
- **wasdtv:record** - **wasdtv:record**
- **wasdtv:stream** - **wasdtv:stream**
@ -1452,7 +1453,7 @@
- **WatchBox** - **WatchBox**
- **WatchIndianPorn**: Watch Indian Porn - **WatchIndianPorn**: Watch Indian Porn
- **WDR** - **WDR**
- **wdr:mobile** (Currently broken) - **wdr:mobile**: (**Currently broken**)
- **WDRElefant** - **WDRElefant**
- **WDRPage** - **WDRPage**
- **web.archive:youtube**: web.archive.org saved youtube videos, "ytarchive:" prefix - **web.archive:youtube**: web.archive.org saved youtube videos, "ytarchive:" prefix
@ -1537,13 +1538,13 @@
- **YoutubeLivestreamEmbed**: YouTube livestream embeds - **YoutubeLivestreamEmbed**: YouTube livestream embeds
- **YoutubeYtBe**: youtu.be - **YoutubeYtBe**: youtu.be
- **Zapiks** - **Zapiks**
- **Zattoo** - **Zattoo**: [<abbr title="netrc machine"><em>zattoo</em></abbr>]
- **ZattooLive** - **ZattooLive**: [<abbr title="netrc machine"><em>zattoo</em></abbr>]
- **ZattooMovies** - **ZattooMovies**: [<abbr title="netrc machine"><em>zattoo</em></abbr>]
- **ZattooRecordings** - **ZattooRecordings**: [<abbr title="netrc machine"><em>zattoo</em></abbr>]
- **ZDF** - **ZDF**
- **ZDFChannel** - **ZDFChannel**
- **Zee5** - **Zee5**: [<abbr title="netrc machine"><em>zee5</em></abbr>]
- **zee5:series** - **zee5:series**
- **ZenYandex** - **ZenYandex**
- **ZenYandexChannel** - **ZenYandexChannel**

@ -5,14 +5,13 @@ __license__ = 'Public Domain'
import itertools import itertools
import os import os
import random
import re import re
import sys import sys
from .compat import compat_getpass, compat_os_name, compat_shlex_quote from .compat import compat_getpass, compat_os_name, compat_shlex_quote
from .cookies import SUPPORTED_BROWSERS, SUPPORTED_KEYRINGS from .cookies import SUPPORTED_BROWSERS, SUPPORTED_KEYRINGS
from .downloader import FileDownloader from .downloader import FileDownloader
from .extractor import gen_extractors, list_extractors from .extractor import list_extractors
from .extractor.adobepass import MSO_INFO from .extractor.adobepass import MSO_INFO
from .extractor.common import InfoExtractor from .extractor.common import InfoExtractor
from .options import parseOpts from .options import parseOpts
@ -75,29 +74,23 @@ def get_urls(urls, batchfile, verbose):
def print_extractor_information(opts, urls): def print_extractor_information(opts, urls):
out = ''
if opts.list_extractors: if opts.list_extractors:
for ie in list_extractors(opts.age_limit): for ie in list_extractors(opts.age_limit):
write_string(ie.IE_NAME + (' (CURRENTLY BROKEN)' if not ie.working() else '') + '\n', out=sys.stdout) out += ie.IE_NAME + (' (CURRENTLY BROKEN)' if not ie.working() else '') + '\n'
matchedUrls = [url for url in urls if ie.suitable(url)] out += ''.join(f' {url}\n' for url in filter(ie.suitable, urls))
for mu in matchedUrls:
write_string(' ' + mu + '\n', out=sys.stdout)
elif opts.list_extractor_descriptions: elif opts.list_extractor_descriptions:
for ie in list_extractors(opts.age_limit): _SEARCHES = ('cute kittens', 'slithering pythons', 'falling cat', 'angry poodle', 'purple fish', 'running tortoise', 'sleeping bunny', 'burping cow')
if not ie.working(): out = '\n'.join(
continue ie.description(markdown=False, search_examples=_SEARCHES)
if ie.IE_DESC is False: for ie in list_extractors(opts.age_limit) if ie.working() and ie.IE_DESC is not False) + '\n'
continue
desc = ie.IE_DESC or ie.IE_NAME
if getattr(ie, 'SEARCH_KEY', None) is not None:
_SEARCHES = ('cute kittens', 'slithering pythons', 'falling cat', 'angry poodle', 'purple fish', 'running tortoise', 'sleeping bunny', 'burping cow')
_COUNTS = ('', '5', '10', 'all')
desc += f'; "{ie.SEARCH_KEY}:" prefix (Example: "{ie.SEARCH_KEY}{random.choice(_COUNTS)}:{random.choice(_SEARCHES)}")'
write_string(desc + '\n', out=sys.stdout)
elif opts.ap_list_mso: elif opts.ap_list_mso:
table = [[mso_id, mso_info['name']] for mso_id, mso_info in MSO_INFO.items()] out = 'Supported TV Providers:\n%s\n' % render_table(
write_string('Supported TV Providers:\n' + render_table(['mso', 'mso name'], table) + '\n', out=sys.stdout) ['mso', 'mso name'],
[[mso_id, mso_info['name']] for mso_id, mso_info in MSO_INFO.items()])
else: else:
return False return False
write_string(out, out=sys.stdout)
return True return True
@ -869,6 +862,7 @@ def main(argv=None):
sys.exit(f'\nERROR: {e}') sys.exit(f'\nERROR: {e}')
from .extractor import gen_extractors
__all__ = [ __all__ = [
'main', 'main',
'YoutubeDL', 'YoutubeDL',

@ -38,14 +38,10 @@ def gen_extractors():
def list_extractors(age_limit): def list_extractors(age_limit):
""" """Return a list of extractors that are suitable for the given age, sorted by extractor name"""
Return a list of extractors that are suitable for the given age, return sorted(filter(
sorted by extractor ID. lambda ie: ie.is_suitable(age_limit),
""" gen_extractors()), key=lambda ie: ie.IE_NAME.lower())
return sorted(
filter(lambda ie: ie.is_suitable(age_limit), gen_extractors()),
key=lambda ie: ie.IE_NAME.lower())
def get_info_extractor(ie_name): def get_info_extractor(ie_name):

@ -469,14 +469,18 @@ class InfoExtractor:
_WORKING = True _WORKING = True
_NETRC_MACHINE = None _NETRC_MACHINE = None
IE_DESC = None IE_DESC = None
SEARCH_KEY = None
_LOGIN_HINTS = { def _login_hint(self, method=NO_DEFAULT, netrc=None):
'any': 'Use --cookies, --cookies-from-browser, --username and --password, or --netrc to provide account credentials', password_hint = f'--username and --password, or --netrc ({netrc or self._NETRC_MACHINE}) to provide account credentials'
'cookies': ( return {
'Use --cookies-from-browser or --cookies for the authentication. ' None: '',
'See https://github.com/ytdl-org/youtube-dl#how-do-i-pass-cookies-to-youtube-dl for how to manually pass cookies'), 'any': f'Use --cookies, --cookies-from-browser, {password_hint}',
'password': 'Use --username and --password, or --netrc to provide account credentials', 'password': f'Use {password_hint}',
} 'cookies': (
'Use --cookies-from-browser or --cookies for the authentication. '
'See https://github.com/ytdl-org/youtube-dl#how-do-i-pass-cookies-to-youtube-dl for how to manually pass cookies'),
}[method if method is not NO_DEFAULT else 'any' if self.supports_login() else 'cookies']
def __init__(self, downloader=None): def __init__(self, downloader=None):
"""Constructor. Receives an optional downloader (a YoutubeDL instance). """Constructor. Receives an optional downloader (a YoutubeDL instance).
@ -539,7 +543,7 @@ class InfoExtractor:
if username: if username:
self._perform_login(username, password) self._perform_login(username, password)
elif self.get_param('username') and False not in (self.IE_DESC, self._NETRC_MACHINE): elif self.get_param('username') and False not in (self.IE_DESC, self._NETRC_MACHINE):
self.report_warning(f'Login with password is not supported for this website. {self._LOGIN_HINTS["cookies"]}') self.report_warning(f'Login with password is not supported for this website. {self._login_hint("cookies")}')
self._real_initialize() self._real_initialize()
self._ready = True self._ready = True
@ -708,7 +712,7 @@ class InfoExtractor:
@property @property
def IE_NAME(self): def IE_NAME(self):
return compat_str(type(self).__name__[:-2]) return type(self).__name__[:-2]
@staticmethod @staticmethod
def __can_accept_status_code(err, expected_status): def __can_accept_status_code(err, expected_status):
@ -1131,11 +1135,7 @@ class InfoExtractor:
self.get_param('ignore_no_formats_error') or self.get_param('wait_for_video')): self.get_param('ignore_no_formats_error') or self.get_param('wait_for_video')):
self.report_warning(msg) self.report_warning(msg)
return return
if method is NO_DEFAULT: msg += format_field(self._login_hint(method), template='. %s')
method = 'any' if self.supports_login() else 'cookies'
if method is not None:
assert method in self._LOGIN_HINTS, 'Invalid login method'
msg = f'{msg}. {self._LOGIN_HINTS[method]}'
raise ExtractorError(msg, expected=True) raise ExtractorError(msg, expected=True)
def raise_geo_restricted( def raise_geo_restricted(
@ -3653,6 +3653,29 @@ class InfoExtractor:
any_restricted = any_restricted or is_restricted any_restricted = any_restricted or is_restricted
return not any_restricted return not any_restricted
def description(self, *, markdown=True, search_examples=None):
"""Description of the extractor"""
desc = ''
if self._NETRC_MACHINE:
if markdown:
desc += f' [<abbr title="netrc machine"><em>{self._NETRC_MACHINE}</em></abbr>]'
else:
desc += f' [{self._NETRC_MACHINE}]'
if self.IE_DESC is False:
desc += ' [HIDDEN]'
elif self.IE_DESC:
desc += f' {self.IE_DESC}'
if self.SEARCH_KEY:
desc += f'; "{self.SEARCH_KEY}:" prefix'
if search_examples:
_COUNTS = ('', '5', '10', 'all')
desc += f' (Example: "{self.SEARCH_KEY}{random.choice(_COUNTS)}:{random.choice(search_examples)}")'
if not self.working():
desc += ' (**Currently broken**)' if markdown else ' (Currently broken)'
name = f' - **{self.IE_NAME}**' if markdown else self.IE_NAME
return f'{name}:{desc}' if desc else name
def extract_subtitles(self, *args, **kwargs): def extract_subtitles(self, *args, **kwargs):
if (self.get_param('writesubtitles', False) if (self.get_param('writesubtitles', False)
or self.get_param('listsubtitles')): or self.get_param('listsubtitles')):

@ -45,7 +45,7 @@ class FujiTVFODPlus7IE(InfoExtractor):
if token: if token:
json_info = self._download_json('https://fod-sp.fujitv.co.jp/apps/api/episode/detail/?ep_id=%s&is_premium=false' % video_id, video_id, headers={'x-authorization': f'Bearer {token.value}'}, fatal=False) json_info = self._download_json('https://fod-sp.fujitv.co.jp/apps/api/episode/detail/?ep_id=%s&is_premium=false' % video_id, video_id, headers={'x-authorization': f'Bearer {token.value}'}, fatal=False)
else: else:
self.report_warning(f'The token cookie is needed to extract video metadata. {self._LOGIN_HINTS["cookies"]}') self.report_warning(f'The token cookie is needed to extract video metadata. {self._login_hint("cookies")}')
formats, subtitles = [], {} formats, subtitles = [], {}
src_json = self._download_json(f'{self._BASE_URL}abrjson_v2/tv_android/{video_id}', video_id) src_json = self._download_json(f'{self._BASE_URL}abrjson_v2/tv_android/{video_id}', video_id)
for src in src_json['video_selector']: for src in src_json['video_selector']:

@ -1333,7 +1333,7 @@ class VimeoReviewIE(VimeoBaseInfoExtractor):
class VimeoWatchLaterIE(VimeoChannelIE): class VimeoWatchLaterIE(VimeoChannelIE):
IE_NAME = 'vimeo:watchlater' IE_NAME = 'vimeo:watchlater'
IE_DESC = 'Vimeo watch later list, "vimeowatchlater" keyword (requires authentication)' IE_DESC = 'Vimeo watch later list, ":vimeowatchlater" keyword (requires authentication)'
_VALID_URL = r'https://vimeo\.com/(?:home/)?watchlater|:vimeowatchlater' _VALID_URL = r'https://vimeo\.com/(?:home/)?watchlater|:vimeowatchlater'
_TITLE = 'Watch Later' _TITLE = 'Watch Later'
_LOGIN_REQUIRED = True _LOGIN_REQUIRED = True

Loading…
Cancel
Save