Skip to content

Commit

Permalink
[CI] auto update yt_dlp to upstream commit c53c2e40fde8f2e15c7c62f8ca…
Browse files Browse the repository at this point in the history
…1a5d9e90ddc079
  • Loading branch information
github-actions[bot] committed May 27, 2024
1 parent ab2b912 commit fdf58d9
Show file tree
Hide file tree
Showing 263 changed files with 1,892 additions and 1,238 deletions.
1,050 changes: 565 additions & 485 deletions lib/yt_dlp/extractor/_extractors.py

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/yt_dlp/extractor/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
dict_get,
ExtractorError,
js_to_json,
dict_get,
int_or_none,
js_to_json,
parse_iso8601,
str_or_none,
traverse_obj,
Expand Down
5 changes: 3 additions & 2 deletions lib/yt_dlp/extractor/abematv.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,21 @@
import urllib.request
import urllib.response
import uuid
from ..utils.networking import clean_proxies

from .common import InfoExtractor
from ..aes import aes_ecb_decrypt
from ..utils import (
ExtractorError,
OnDemandPagedList,
bytes_to_intlist,
decode_base_n,
int_or_none,
intlist_to_bytes,
OnDemandPagedList,
time_seconds,
traverse_obj,
update_url_query,
)
from ..utils.networking import clean_proxies


def add_opener(ydl, handler): # FIXME: Create proper API in .networking
Expand Down
4 changes: 2 additions & 2 deletions lib/yt_dlp/extractor/acfun.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
float_or_none,
format_field,
int_or_none,
str_or_none,
traverse_obj,
parse_codecs,
parse_qs,
str_or_none,
traverse_obj,
)


Expand Down
4 changes: 2 additions & 2 deletions lib/yt_dlp/extractor/adn.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
from ..compat import compat_b64decode
from ..networking.exceptions import HTTPError
from ..utils import (
ExtractorError,
ass_subtitles_timecode,
bytes_to_intlist,
bytes_to_long,
ExtractorError,
float_or_none,
int_or_none,
intlist_to_bytes,
long_to_bytes,
parse_iso8601,
pkcs1pad,
strip_or_none,
str_or_none,
strip_or_none,
try_get,
unified_strdate,
urlencode_postdata,
Expand Down
4 changes: 2 additions & 2 deletions lib/yt_dlp/extractor/adobetv.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
ISO639Utils,
OnDemandPagedList,
float_or_none,
int_or_none,
ISO639Utils,
join_nonempty,
OnDemandPagedList,
parse_duration,
str_or_none,
str_to_int,
Expand Down
2 changes: 1 addition & 1 deletion lib/yt_dlp/extractor/airtv.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
int_or_none,
mimetype2ext,
parse_iso8601,
traverse_obj
traverse_obj,
)


Expand Down
1 change: 0 additions & 1 deletion lib/yt_dlp/extractor/allstar.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
)
from ..utils.traversal import traverse_obj


_FIELDS = '''
_id
clipImageSource
Expand Down
4 changes: 2 additions & 2 deletions lib/yt_dlp/extractor/alphaporno.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from .common import InfoExtractor
from ..utils import (
parse_iso8601,
int_or_none,
parse_duration,
parse_filesize,
int_or_none,
parse_iso8601,
)


Expand Down
12 changes: 4 additions & 8 deletions lib/yt_dlp/extractor/alura.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import re

from .common import InfoExtractor

from ..compat import (
compat_urlparse,
)

from ..compat import compat_urlparse
from ..utils import (
ExtractorError,
clean_html,
int_or_none,
urlencode_postdata,
urljoin,
int_or_none,
clean_html,
ExtractorError
)


Expand Down
2 changes: 1 addition & 1 deletion lib/yt_dlp/extractor/amara.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from .common import InfoExtractor
from .youtube import YoutubeIE
from .vimeo import VimeoIE
from .youtube import YoutubeIE
from ..utils import (
int_or_none,
parse_iso8601,
Expand Down
2 changes: 1 addition & 1 deletion lib/yt_dlp/extractor/amp.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from .common import InfoExtractor
from ..utils import (
determine_ext,
ExtractorError,
determine_ext,
int_or_none,
mimetype2ext,
parse_iso8601,
Expand Down
2 changes: 1 addition & 1 deletion lib/yt_dlp/extractor/anchorfm.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
int_or_none,
str_or_none,
traverse_obj,
unified_timestamp
unified_timestamp,
)


Expand Down
2 changes: 1 addition & 1 deletion lib/yt_dlp/extractor/angel.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import re

from .common import InfoExtractor
from ..utils import url_or_none, merge_dicts
from ..utils import merge_dicts, url_or_none


class AngelIE(InfoExtractor):
Expand Down
5 changes: 1 addition & 4 deletions lib/yt_dlp/extractor/appleconnect.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
from .common import InfoExtractor
from ..utils import (
str_to_int,
ExtractorError
)
from ..utils import ExtractorError, str_to_int


class AppleConnectIE(InfoExtractor):
Expand Down
2 changes: 1 addition & 1 deletion lib/yt_dlp/extractor/appletrailers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import re
import json
import re

from .common import InfoExtractor
from ..compat import compat_urlparse
Expand Down
2 changes: 1 addition & 1 deletion lib/yt_dlp/extractor/arnes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
compat_urllib_parse_urlparse,
)
from ..utils import (
format_field,
float_or_none,
format_field,
int_or_none,
parse_iso8601,
remove_start,
Expand Down
2 changes: 1 addition & 1 deletion lib/yt_dlp/extractor/atvat.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

from .common import InfoExtractor
from ..utils import (
ExtractorError,
float_or_none,
jwt_encode_hs256,
try_get,
ExtractorError,
)


Expand Down
2 changes: 1 addition & 1 deletion lib/yt_dlp/extractor/awaan.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from .common import InfoExtractor
from ..compat import (
compat_urllib_parse_urlencode,
compat_str,
compat_urllib_parse_urlencode,
)
from ..utils import (
format_field,
Expand Down
4 changes: 2 additions & 2 deletions lib/yt_dlp/extractor/banbye.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

from .common import InfoExtractor
from ..compat import (
compat_urllib_parse_urlparse,
compat_parse_qs,
compat_urllib_parse_urlparse,
)
from ..utils import (
format_field,
InAdvancePagedList,
format_field,
traverse_obj,
unified_timestamp,
)
Expand Down
6 changes: 3 additions & 3 deletions lib/yt_dlp/extractor/bannedvideo.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

from .common import InfoExtractor
from ..utils import (
try_get,
int_or_none,
url_or_none,
float_or_none,
int_or_none,
try_get,
unified_timestamp,
url_or_none,
)


Expand Down
1 change: 0 additions & 1 deletion lib/yt_dlp/extractor/beeg.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from .common import InfoExtractor

from ..utils import (
int_or_none,
str_or_none,
Expand Down
2 changes: 1 addition & 1 deletion lib/yt_dlp/extractor/bleacherreport.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .common import InfoExtractor
from .amp import AMPIE
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
Expand Down
2 changes: 1 addition & 1 deletion lib/yt_dlp/extractor/blogger.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from .common import InfoExtractor
from ..utils import (
mimetype2ext,
parse_duration,
parse_qs,
str_or_none,
traverse_obj,
)
from .common import InfoExtractor


class BloggerIE(InfoExtractor):
Expand Down
1 change: 0 additions & 1 deletion lib/yt_dlp/extractor/bostonglobe.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import re

from .common import InfoExtractor

from ..utils import (
extract_attributes,
)
Expand Down
6 changes: 1 addition & 5 deletions lib/yt_dlp/extractor/boxcast.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
from .common import InfoExtractor
from ..utils import (
js_to_json,
traverse_obj,
unified_timestamp
)
from ..utils import js_to_json, traverse_obj, unified_timestamp


class BoxCastVideoIE(InfoExtractor):
Expand Down
2 changes: 1 addition & 1 deletion lib/yt_dlp/extractor/brainpop.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
classproperty,
int_or_none,
traverse_obj,
urljoin
urljoin,
)


Expand Down
4 changes: 2 additions & 2 deletions lib/yt_dlp/extractor/brightcove.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
)
from ..networking.exceptions import HTTPError
from ..utils import (
ExtractorError,
UnsupportedError,
clean_html,
dict_get,
extract_attributes,
ExtractorError,
find_xpath_attr,
fix_xml_ampersands,
float_or_none,
Expand All @@ -29,7 +30,6 @@
try_get,
unescapeHTML,
unsmuggle_url,
UnsupportedError,
update_url_query,
url_or_none,
)
Expand Down
74 changes: 74 additions & 0 deletions lib/yt_dlp/extractor/caffeinetv.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
from .common import InfoExtractor
from ..utils import (
determine_ext,
int_or_none,
parse_iso8601,
traverse_obj,
urljoin,
)


class CaffeineTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?caffeine\.tv/[^/?#]+/video/(?P<id>[\da-f-]+)'
_TESTS = [{
'url': 'https://www.caffeine.tv/TsuSurf/video/cffc0a00-e73f-11ec-8080-80017d29f26e',
'info_dict': {
'id': 'cffc0a00-e73f-11ec-8080-80017d29f26e',
'ext': 'mp4',
'title': 'GOOOOD MORNINNNNN #highlights',
'timestamp': 1654702180,
'upload_date': '20220608',
'uploader': 'RahJON Wicc',
'uploader_id': 'TsuSurf',
'duration': 3145,
'age_limit': 17,
'thumbnail': 'https://www.caffeine.tv/broadcasts/776b6f84-9cd5-42e3-af1d-4a776eeed697/replay/lobby.jpg',
'comment_count': int,
'view_count': int,
'like_count': int,
'tags': ['highlights', 'battlerap'],
},
'params': {
'skip_download': 'm3u8',
},
}]

def _real_extract(self, url):
video_id = self._match_id(url)
json_data = self._download_json(
f'https://api.caffeine.tv/social/public/activity/{video_id}', video_id)
broadcast_info = traverse_obj(json_data, ('broadcast_info', {dict})) or {}

video_url = broadcast_info['video_url']
ext = determine_ext(video_url)
if ext == 'm3u8':
formats = self._extract_m3u8_formats(video_url, video_id, 'mp4')
else:
formats = [{'url': video_url}]

return {
'id': video_id,
'formats': formats,
**traverse_obj(json_data, {
'like_count': ('like_count', {int_or_none}),
'view_count': ('view_count', {int_or_none}),
'comment_count': ('comment_count', {int_or_none}),
'tags': ('tags', ..., {str}, {lambda x: x or None}),
'uploader': ('user', 'name', {str}),
'uploader_id': (((None, 'user'), 'username'), {str}, any),
'is_live': ('is_live', {bool}),
}),
**traverse_obj(broadcast_info, {
'title': ('broadcast_title', {str}),
'duration': ('content_duration', {int_or_none}),
'timestamp': ('broadcast_start_time', {parse_iso8601}),
'thumbnail': ('preview_image_path', {lambda x: urljoin(url, x)}),
}),
'age_limit': {
# assume Apple Store ratings: https://en.wikipedia.org/wiki/Mobile_software_content_rating_system
'FOUR_PLUS': 0,
'NINE_PLUS': 9,
'TWELVE_PLUS': 12,
'SEVENTEEN_PLUS': 17,
}.get(broadcast_info.get('content_rating'), 17),
}
Loading

0 comments on commit fdf58d9

Please sign in to comment.