mirror of https://github.com/yt-dlp/yt-dlp.git
Compare commits
4 Commits
52c6dce5fb
...
ec53d1b406
Author | SHA1 | Date |
---|---|---|
Leo Heitmann Ruiz | ec53d1b406 | |
bashonly | 1a366403d9 | |
Simon Sawicki | 7e26bd53f9 | |
Leo Heitmann Ruiz | 9cd9167b25 |
|
@ -300,7 +300,7 @@ jobs:
|
|||
macos_legacy:
|
||||
needs: process
|
||||
if: inputs.macos_legacy
|
||||
runs-on: macos-latest
|
||||
runs-on: macos-12
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
|
12
README.md
12
README.md
|
@ -1944,12 +1944,12 @@ import yt_dlp
|
|||
|
||||
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 = {}
|
||||
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
|
||||
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)))
|
||||
```
|
||||
#### Download using an info-json
|
||||
|
@ -1975,7 +1975,7 @@ URLS = ['https://www.youtube.com/watch?v=BaW_jenozKc']
|
|||
|
||||
ydl_opts = {
|
||||
'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
|
||||
'key': 'FFmpegExtractAudio',
|
||||
'preferredcodec': 'm4a',
|
||||
|
@ -2033,7 +2033,7 @@ class MyLogger:
|
|||
print(msg)
|
||||
|
||||
|
||||
# ℹ️ See "progress_hooks" in help(yt_dlp.YoutubeDL)
|
||||
# See "progress_hooks" in help(yt_dlp.YoutubeDL)
|
||||
def my_hook(d):
|
||||
if d['status'] == 'finished':
|
||||
print('Done downloading, now post-processing ...')
|
||||
|
@ -2055,7 +2055,7 @@ import yt_dlp
|
|||
|
||||
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):
|
||||
def run(self, info):
|
||||
self.to_screen('Doing stuff')
|
||||
|
@ -2063,7 +2063,7 @@ class MyCustomPP(yt_dlp.postprocessor.PostProcessor):
|
|||
|
||||
|
||||
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.download(URLS)
|
||||
```
|
||||
|
|
|
@ -2090,10 +2090,7 @@ Line 1
|
|||
|
||||
args = [sys.executable, '-c', 'import sys; print(end=sys.argv[1])', argument, 'end']
|
||||
assert run_shell(args) == expected
|
||||
|
||||
escaped = shell_quote(argument, shell=True)
|
||||
args = f'{sys.executable} -c "import sys; print(end=sys.argv[1])" {escaped} end'
|
||||
assert run_shell(args) == expected
|
||||
assert run_shell(shell_quote(args, shell=True)) == expected
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Reference in New Issue