Compare commits
No commits in common. "ec7e2036fbfdf7e63354c7b3980fa323fb1e25a9" and "47bd80c85eaf3634b2041b9e8e00d5c9c5dbae93" have entirely different histories.
ec7e2036fb
...
47bd80c85e
9
.gitignore
vendored
9
.gitignore
vendored
@ -1,5 +1,3 @@
|
|||||||
*.mp3
|
|
||||||
*.webp
|
|
||||||
# ---> Linux
|
# ---> Linux
|
||||||
*~
|
*~
|
||||||
|
|
||||||
@ -145,13 +143,6 @@ venv/
|
|||||||
ENV/
|
ENV/
|
||||||
env.bak/
|
env.bak/
|
||||||
venv.bak/
|
venv.bak/
|
||||||
bin/
|
|
||||||
include/
|
|
||||||
lib/
|
|
||||||
lib64/
|
|
||||||
share/
|
|
||||||
pyvenv.*
|
|
||||||
lib64
|
|
||||||
|
|
||||||
# Spyder project settings
|
# Spyder project settings
|
||||||
.spyderproject
|
.spyderproject
|
||||||
|
30
download.py
30
download.py
@ -1,30 +0,0 @@
|
|||||||
import yt_dlp as yt
|
|
||||||
|
|
||||||
def get(yt_url):
|
|
||||||
ytdl_options = {
|
|
||||||
'continuedl': True,
|
|
||||||
'ignoreerrors': True,
|
|
||||||
'outtmpl': '%(title)s.%(ext)s',
|
|
||||||
'no_warning': True,
|
|
||||||
'progress_hooks': [dl_progress],
|
|
||||||
#'quiet': True,
|
|
||||||
'writethumbnail': True,
|
|
||||||
'embed_metadata': True,
|
|
||||||
'format': 'any/bestaudio/best',
|
|
||||||
# ℹ️ See help(yt_dlp.postprocessor) for a list of available Postprocessors and their arguments
|
|
||||||
'postprocessors': [{ # Extract audio using ffmpeg
|
|
||||||
'key': 'FFmpegMetadata'
|
|
||||||
},{
|
|
||||||
'key': 'FFmpegExtractAudio',
|
|
||||||
'preferredcodec': 'mp3',
|
|
||||||
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
|
|
||||||
with yt.YoutubeDL(ytdl_options) as ytdl:
|
|
||||||
ytdl.download(yt_url)
|
|
||||||
|
|
||||||
|
|
||||||
def dl_progress(d):
|
|
||||||
if (d['status'] == 'finished'):
|
|
||||||
print("\nDownload completed.")
|
|
@ -1 +0,0 @@
|
|||||||
yt-dlp
|
|
18
yt2mp3.py
18
yt2mp3.py
@ -1,18 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
import argparse
|
|
||||||
import download
|
|
||||||
|
|
||||||
script_version = "0.2"
|
|
||||||
help_epilog = ("This script is very dependent on yt-dlp.\n"+
|
|
||||||
"If it's not working properly try updating yt-dlp.")
|
|
||||||
|
|
||||||
cmd_option_set = argparse.ArgumentParser(description='Backup YouTube channels.', epilog=help_epilog)
|
|
||||||
cmd_option_set.add_argument('--version', '-v', dest='print_version', action='store_true', help='Print the current version number.')
|
|
||||||
cmd_option_set.add_argument(dest='url_to_convert', help="The URL of the YouTube video you're converting to a local mp3.")
|
|
||||||
cmd_options = cmd_option_set.parse_args()
|
|
||||||
|
|
||||||
if (cmd_options.print_version):
|
|
||||||
print("Version: " + script_version)
|
|
||||||
else:
|
|
||||||
download.get(cmd_options.url_to_convert)
|
|
Loading…
x
Reference in New Issue
Block a user