Skip to content

Commit

Permalink
Fix RenamePP bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashish0804 committed May 20, 2022
1 parent 713117c commit 881267b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
14 changes: 9 additions & 5 deletions yt_dlp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,10 +495,10 @@ def report_unplayable_conflict(opt_name, arg, default=False, allowed=None):
if len(dur) == 2 and all(t is not None for t in dur):
remove_ranges.append(tuple(dur))
continue
#parser.error(f'invalid --remove-chapters time range {regex!r}. Must be of the form *start-end')
# parser.error(f'invalid --remove-chapters time range {regex!r}. Must be of the form *start-end')
try:
remove_chapters_patterns.append(re.compile(regex))
except re.error as err:
except re.error:
pass
# parser.error(f'invalid --remove-chapters regex {regex!r} - {err}')
if opts.remove_chapters:
Expand Down Expand Up @@ -581,9 +581,6 @@ def report_unplayable_conflict(opt_name, arg, default=False, allowed=None):
'when': when,
})

def report_args_compat(arg, name):
warnings.append('%s given without specifying name. The arguments will be given to all %s' % (arg, name))

if 'default' in opts.external_downloader_args:
report_args_compat('--downloader-args', 'external downloaders')

Expand Down Expand Up @@ -798,6 +795,13 @@ def get_postprocessors(opts):
'only_multi_video': opts.concat_playlist != 'always',
'when': 'playlist',
}
if opts.group:
yield {
'key': 'Rename',
'group': opts.group,
# Run this only after the files have been moved to their final locations
'when': 'after_move'
}
# Exec must be the last PP of each category
for when, exec_cmd in opts.exec_cmd.items():
yield {
Expand Down
12 changes: 6 additions & 6 deletions yt_dlp/extractor/docubay.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from .common import InfoExtractor


class DocubayIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?docubay\.com/[^#/?$]+-(?P<id>\d+)'

Expand All @@ -18,9 +19,11 @@ class DocubayIE(InfoExtractor):

def _real_extract(self, url):
video_id = self._match_id(url)
data_json = self._parse_json(self._download_json(self._API_URL, video_id,
headers={'content-type': 'application/x-www-form-urlencoded; charset=UTF-8'},
data=f'cid={video_id}&action=st&type=video'.encode()), video_id)
data_json = self._parse_json(self._download_json(
self._API_URL,
video_id,
headers={'content-type': 'application/x-www-form-urlencoded; charset=UTF-8'},
data=f'cid={video_id}&action=st&type=video'.encode()), video_id)

formats, subtitles = self._extract_m3u8_formats_and_subtitles(data_json['url']['video_url'], video_id)
subs = {}
Expand Down Expand Up @@ -53,6 +56,3 @@ def _real_extract(self, url):
'subtitles': subtitles

}



0 comments on commit 881267b

Please sign in to comment.