Update download.py
This commit is contained in:
parent
052d11d15b
commit
04e93cad07
@ -1,7 +1,13 @@
|
|||||||
import os, yt_dlp, json, requests, re
|
import os, yt_dlp, json, requests, re, logging
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
from urllib.parse import urlsplit
|
from urllib.parse import urlsplit
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
# Define the hook function
|
||||||
|
def my_hook(d):
|
||||||
|
if d['status'] == 'finished':
|
||||||
|
logging.info(f"Download completed: {d['filename']}")
|
||||||
|
|
||||||
def ebook(url, author):
|
def ebook(url, author):
|
||||||
destination = f"/ebooks/{author}"
|
destination = f"/ebooks/{author}"
|
||||||
@ -118,6 +124,7 @@ class dropout():
|
|||||||
filename_template = f"{show} - S{int(season):02}E{episode_number} - %(title)s.%(ext)s"
|
filename_template = f"{show} - S{int(season):02}E{episode_number} - %(title)s.%(ext)s"
|
||||||
|
|
||||||
dl_opts = {
|
dl_opts = {
|
||||||
|
'progress_hooks': [my_hook],
|
||||||
'format': 'bestvideo+bestaudio/best',
|
'format': 'bestvideo+bestaudio/best',
|
||||||
'audio_quality': '256K',
|
'audio_quality': '256K',
|
||||||
'paths': {
|
'paths': {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user