]> jfr.im git - yt-dlp.git/blame - yt_dlp/extractor/commonprotocols.py
[youtube] Add extractor-arg to skip auto-translated subs
[yt-dlp.git] / yt_dlp / extractor / commonprotocols.py
CommitLineData
19e2617a
S
1from __future__ import unicode_literals
2
54df8fc5 3
19e2617a
S
4from .common import InfoExtractor
5from ..compat import (
19e2617a
S
6 compat_urlparse,
7)
19e2617a
S
8
9
10class RtmpIE(InfoExtractor):
11 IE_DESC = False # Do not list
12 _VALID_URL = r'(?i)rtmp[est]?://.+'
13
14 _TESTS = [{
15 'url': 'rtmp://cp44293.edgefcs.net/ondemand?auth=daEcTdydfdqcsb8cZcDbAaCbhamacbbawaS-bw7dBb-bWG-GqpGFqCpNCnGoyL&aifp=v001&slist=public/unsecure/audio/2c97899446428e4301471a8cb72b4b97--audio--pmg-20110908-0900a_flv_aac_med_int.mp4',
16 'only_matching': True,
17 }, {
18 'url': 'rtmp://edge.live.hitbox.tv/live/dimak',
19 'only_matching': True,
20 }]
21
22 def _real_extract(self, url):
9dcd6fd3
YCH
23 video_id = self._generic_id(url)
24 title = self._generic_title(url)
19e2617a
S
25 return {
26 'id': video_id,
27 'title': title,
28 'formats': [{
29 'url': url,
30 'ext': 'flv',
31 'format_id': compat_urlparse.urlparse(url).scheme,
32 }],
33 }
9dcd6fd3
YCH
34
35
36class MmsIE(InfoExtractor):
37 IE_DESC = False # Do not list
38 _VALID_URL = r'(?i)mms://.+'
39
40 _TEST = {
41 # Direct MMS link
42 'url': 'mms://kentro.kaist.ac.kr/200907/MilesReid(0709).wmv',
43 'info_dict': {
44 'id': 'MilesReid(0709)',
45 'ext': 'wmv',
46 'title': 'MilesReid(0709)',
47 },
48 'params': {
49 'skip_download': True, # rtsp downloads, requiring mplayer or mpv
50 },
51 }
52
53 def _real_extract(self, url):
54 video_id = self._generic_id(url)
55 title = self._generic_title(url)
56
57 return {
58 'id': video_id,
59 'title': title,
60 'url': url,
61 }
54df8fc5 62
63
64class ViewSourceIE(InfoExtractor):
65 IE_DESC = False
66 _VALID_URL = r'view-source:(?P<url>.+)'
67
68 _TEST = {
69 'url': 'view-source:https://www.youtube.com/watch?v=BaW_jenozKc',
70 'only_matching': True
71 }
72
73 def _real_extract(self, url):
5ad28e7f 74 return self.url_result(self._match_valid_url(url).group('url'))