Compare commits

...

11 Commits

Author SHA1 Message Date
01001110 5c215ebbea
Merge b8f7389a71 into e0727e4ab6 2024-04-20 04:09:26 +08:00
dirkf e0727e4ab6 [postprocessor/ffmpeg] Fix finding ffprobe (bug in 21792b8)
Fixes 21792b88b7 (commitcomment-140705274), thx: vonProteus
2024-04-07 15:33:30 +01:00
Ori Avtalion 4ea59c6107
[utils] Fix crash in _report_ignoring_subs from c58b655 (#32762)
Align `utils.bug_reports_message()` with yt-dlp https://github.com/yt-dlp/yt-dlp/commit/5873d4ccdd, thanks fstirlitz

---------

Co-authored-by: dirkf <fieldhouse@gmx.net>
2024-04-05 15:25:29 +01:00
01001110 b8f7389a71 update tests checksums 2023-10-03 00:29:54 +08:00
01001110 1250269c74
Merge branch 'ytdl-org:master' into chelseafc-extractor 2023-10-03 00:04:15 +08:00
dirkf 7059253820
Update extractors.py
* sort extractor modules
2023-04-06 01:45:06 +01:00
01001110 24e84f0000 Change regex for better matching 2023-04-02 19:31:05 +08:00
01001110 6a9848f94a Modify extractor according to suggestions 2023-04-02 18:32:21 +08:00
01001110 a9a4d68364 Edit tests 2023-04-02 18:28:44 +08:00
01001110 ceaa2c78fa [chelseafc] improve regex 2023-03-24 16:22:13 +08:00
01001110 b478a0ac3f [chelseafc] Add new extractor 2023-03-23 20:56:38 +08:00
4 changed files with 114 additions and 11 deletions

View File

@ -0,0 +1,83 @@
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
parse_duration,
traverse_obj,
unified_timestamp,
url_or_none,
)
class ChelseafcIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?chelseafc\.com(?:/[a-z]+)?/video/(?P<id>[a-z0-9]+(?:-[a-z0-9]+)*)'
_TESTS = [{
'url': 'https://www.chelseafc.com/en/video/full-match-chelsea-2-2-everton',
'md5': '2fda617911b7148a2a19bec55b75d30a',
'info_dict': {
'id': 'full-match-chelsea-2-2-everton',
'ext': 'mp4',
'title': 'Full Match: Chelsea 2-2 Everton',
'description': 'Full match highlights from Chelsea\'s 2-2 Premier League draw with Everton at Stamford Bridge.',
'duration': 2842.0,
'timestamp': 1679184000,
'tags': ['Premier League', 'Everton', 'Video and article choice'],
'upload_date': '20230319',
'thumbnail': r're:https?://.*\.png'
}
},
{
'url': 'https://www.chelseafc.com/en/video/manchester-city-vs-chelsea-2-0-or-highlights-or-efl-cup',
'md5': '2905365c3c9cf4612f303fbb99c2f4ca',
'info_dict': {
'id': 'manchester-city-vs-chelsea-2-0-or-highlights-or-efl-cup',
'ext': 'mp4',
'title': 'Manchester City 2-0 Chelsea | Highlights | EFL Cup',
'description': 'Highlights from our EFL Cup match against Man City.',
'duration': 120.0,
'timestamp': 1668042000,
'upload_date': '20221110',
'tags': ['Highlights', 'League Cup', 'Manchester City'],
'thumbnail': r're:https?://.*\.jpg'
}
}]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
video_details_div = self._search_regex(
r'(<div\s[^>]*\bdata-component\s*=\s*(?:"|\')\s*VideoDetails\s*(?:"|\')[^>]*>)',
webpage,
'div'
)
raw_data = self._html_search_regex(
r'<div[^>]*\sdata-props\s*=\s*(?:"|\')\s*([^"\']*)\s*(?:"|\')[^>]*>',
video_details_div,
'data'
)
data = self._parse_json(raw_data, video_id)
manifest_url = data['videoDetail']['signedUrl']
data = data['videoDetail']
title = data['title']
formats = self._extract_m3u8_formats(manifest_url, video_id, 'mp4')
self._sort_formats(formats)
txt_or_none = lambda x: x.strip() or None
return {
'id': video_id,
'title': title,
'description': txt_or_none(data.get('description')),
'formats': formats,
'duration': parse_duration(data.get('duration')),
'timestamp': unified_timestamp(data.get('releaseDate')),
'tags': traverse_obj(data, ('tags', Ellipsis, 'title'), expected_type=txt_or_none),
'thumbnail': traverse_obj(data, ('image', 'file', 'url'), expected_type=url_or_none),
}

View File

@ -215,6 +215,7 @@ from .ceskatelevize import CeskaTelevizeIE
from .channel9 import Channel9IE
from .charlierose import CharlieRoseIE
from .chaturbate import ChaturbateIE
from .chelseafc import ChelseafcIE
from .chilloutzone import ChilloutzoneIE
from .chirbit import (
ChirbitIE,
@ -997,6 +998,10 @@ from .puhutv import (
PuhuTVIE,
PuhuTVSerieIE,
)
from .pr0gramm import (
Pr0grammIE,
Pr0grammStaticIE,
)
from .presstv import PressTVIE
from .prosiebensat1 import ProSiebenSat1IE
from .puls4 import Puls4IE

View File

@ -74,8 +74,11 @@ class FFmpegPostProcessor(PostProcessor):
return FFmpegPostProcessor(downloader)._versions
def _determine_executables(self):
programs = ['avprobe', 'avconv', 'ffmpeg', 'ffprobe']
# ordered to match prefer_ffmpeg!
convs = ['ffmpeg', 'avconv']
probes = ['ffprobe', 'avprobe']
prefer_ffmpeg = True
programs = convs + probes
def get_ffmpeg_version(path):
ver = get_exe_version(path, args=['-version'])
@ -127,10 +130,13 @@ class FFmpegPostProcessor(PostProcessor):
(p, get_ffmpeg_version(self._paths[p])) for p in programs)
if x[1] is not None)
for p in ('ffmpeg', 'avconv')[::-1 if prefer_ffmpeg is False else 1]:
if self._versions.get(p):
self.basename = self.probe_basename = p
break
basenames = [None, None]
for i, progs in enumerate((convs, probes)):
for p in progs[::-1 if prefer_ffmpeg is False else 1]:
if self._versions.get(p):
basenames[i] = p
break
self.basename, self.probe_basename = basenames
@property
def available(self):

View File

@ -2371,15 +2371,24 @@ def make_HTTPS_handler(params, **kwargs):
return YoutubeDLHTTPSHandler(params, context=context, **kwargs)
def bug_reports_message():
def bug_reports_message(before=';'):
if ytdl_is_updateable():
update_cmd = 'type youtube-dl -U to update'
else:
update_cmd = 'see https://yt-dl.org/update on how to update'
msg = '; please report this issue on https://yt-dl.org/bug .'
msg += ' Make sure you are using the latest version; %s.' % update_cmd
msg += ' Be sure to call youtube-dl with the --verbose flag and include its complete output.'
return msg
update_cmd = 'see https://github.com/ytdl-org/youtube-dl/#user-content-installation on how to update'
msg = (
'please report this issue on https://github.com/ytdl-org/youtube-dl/issues ,'
' using the appropriate issue template.'
' Make sure you are using the latest version; %s.'
' Be sure to call youtube-dl with the --verbose option and include the complete output.'
) % update_cmd
before = (before or '').rstrip()
if not before or before.endswith(('.', '!', '?')):
msg = msg[0].title() + msg[1:]
return (before + ' ' if before else '') + msg
class YoutubeDLError(Exception):