Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

liveleak: add original format without watermark #17625

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions youtube_dl/extractor/liveleak.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,17 @@ def _real_extract(self, url):
}

for idx, info_dict in enumerate(entries):
source_found = False
for a_format in info_dict['formats']:
if not source_found:
source_url = re.sub(r'(https?://(?:\w+\.)?liveleak\.com/.*?\.\w+)\.\w+\.mp4((?:\?.+)?)', r'\1\2', a_format['url'])
jomo marked this conversation as resolved.
Show resolved Hide resolved
if source_url != a_format['url']:
source_found = True
jomo marked this conversation as resolved.
Show resolved Hide resolved
info_dict['formats'].append({
'url': source_url,
'format_note': 'original, without watermark',
'format_id': 'source'
})
if not a_format.get('height'):
a_format['height'] = int_or_none(self._search_regex(
r'([0-9]+)p\.mp4', a_format['url'], 'height label',
Expand Down