Skip to content

Commit

Permalink
testurl: add extractor for testing miscellaneous things
Browse files Browse the repository at this point in the history
* not recomendded for public use
  • Loading branch information
Lesmiscore committed Mar 8, 2022
1 parent feba3d3 commit 93c509d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion yt_dlp/extractor/extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -1658,7 +1658,7 @@
from .telewebion import TelewebionIE
from .tennistv import TennisTVIE
from .tenplay import TenPlayIE
from .testurl import TestURLIE
from .testurl import TestURLIE, TestInfoDictIE
from .tf1 import TF1IE
from .tfo import TFOIE
from .theintercept import TheInterceptIE
Expand Down
26 changes: 26 additions & 0 deletions yt_dlp/extractor/testurl.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,29 @@ def _real_extract(self, url):
self.to_screen('Test URL: %s' % tc['url'])

return self.url_result(tc['url'], video_id=video_id)


class TestInfoDictIE(InfoExtractor):
""" IE to carry out some tests """

IE_DESC = False # Do not list
_VALID_URL = r'^testdict$'

def _real_extract(self, url):
return {
'id': 'testdict',
'title': 'taitoru',
'formats': [{
'format_id': ' space',
'url': 'https://example.com/'
}, {
'format_id': 'middle space',
'url': 'https://example.com/'
}, {
'format_id': 'what*the!fuck',
'url': 'https://example.com/'
}, {
'format_id': 'some(more)thing',
'url': 'https://example.com/'
}],
}

0 comments on commit 93c509d

Please sign in to comment.