Remove emoji

This commit is contained in:
Leo Heitmann Ruiz 2024-03-11 11:20:43 +01:00 committed by GitHub
parent 8463fb510a
commit 9cd9167b25
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 6 deletions

View File

@ -1920,12 +1920,12 @@ import yt_dlp
URL = 'https://www.youtube.com/watch?v=BaW_jenozKc' URL = 'https://www.youtube.com/watch?v=BaW_jenozKc'
# See help(yt_dlp.YoutubeDL) for a list of available options and public functions # See help(yt_dlp.YoutubeDL) for a list of available options and public functions
ydl_opts = {} ydl_opts = {}
with yt_dlp.YoutubeDL(ydl_opts) as ydl: with yt_dlp.YoutubeDL(ydl_opts) as ydl:
info = ydl.extract_info(URL, download=False) info = ydl.extract_info(URL, download=False)
# ydl.sanitize_info makes the info json-serializable # ydl.sanitize_info makes the info json-serializable
print(json.dumps(ydl.sanitize_info(info))) print(json.dumps(ydl.sanitize_info(info)))
``` ```
#### Download using an info-json #### Download using an info-json
@ -1951,7 +1951,7 @@ URLS = ['https://www.youtube.com/watch?v=BaW_jenozKc']
ydl_opts = { ydl_opts = {
'format': 'm4a/bestaudio/best', 'format': 'm4a/bestaudio/best',
# See help(yt_dlp.postprocessor) for a list of available Postprocessors and their arguments # See help(yt_dlp.postprocessor) for a list of available Postprocessors and their arguments
'postprocessors': [{ # Extract audio using ffmpeg 'postprocessors': [{ # Extract audio using ffmpeg
'key': 'FFmpegExtractAudio', 'key': 'FFmpegExtractAudio',
'preferredcodec': 'm4a', 'preferredcodec': 'm4a',
@ -2009,7 +2009,7 @@ class MyLogger:
print(msg) print(msg)
# See "progress_hooks" in help(yt_dlp.YoutubeDL) # See "progress_hooks" in help(yt_dlp.YoutubeDL)
def my_hook(d): def my_hook(d):
if d['status'] == 'finished': if d['status'] == 'finished':
print('Done downloading, now post-processing ...') print('Done downloading, now post-processing ...')
@ -2031,7 +2031,7 @@ import yt_dlp
URLS = ['https://www.youtube.com/watch?v=BaW_jenozKc'] URLS = ['https://www.youtube.com/watch?v=BaW_jenozKc']
# See help(yt_dlp.postprocessor.PostProcessor) # See help(yt_dlp.postprocessor.PostProcessor)
class MyCustomPP(yt_dlp.postprocessor.PostProcessor): class MyCustomPP(yt_dlp.postprocessor.PostProcessor):
def run(self, info): def run(self, info):
self.to_screen('Doing stuff') self.to_screen('Doing stuff')
@ -2039,7 +2039,7 @@ class MyCustomPP(yt_dlp.postprocessor.PostProcessor):
with yt_dlp.YoutubeDL() as ydl: with yt_dlp.YoutubeDL() as ydl:
# "when" can take any value in yt_dlp.utils.POSTPROCESS_WHEN # "when" can take any value in yt_dlp.utils.POSTPROCESS_WHEN
ydl.add_post_processor(MyCustomPP(), when='pre_process') ydl.add_post_processor(MyCustomPP(), when='pre_process')
ydl.download(URLS) ydl.download(URLS)
``` ```