Browse Source

Default to yt-dlp

master
blank X 2 months ago
parent
commit
855ec364ce
Signed by: blankie GPG Key ID: CC15FC822C7F61F5
  1. 7
      autoytarchive/utils.py
  2. 7
      autoytarchive/workers.py
  3. 2
      requirements.txt

7
autoytarchive/utils.py

@ -1,10 +1,15 @@
import sys
import time
import json
import random
import logging
import feedparser
from io import BytesIO
from youtube_dl.extractor import youtube
try:
from yt_dlp.extractor import youtube
except Exception as e:
print(f'Failed to import yt_dlp due to {type(e).__name__}: {e}, importing youtube_dl', file=sys.stderr)
from youtube_dl.extractor import youtube
from . import config, client, seen_videos
youtube._try_get = _try_get = youtube.try_get

7
autoytarchive/workers.py

@ -1,5 +1,6 @@
import re
import os
import sys
import json
import time
import random
@ -10,7 +11,11 @@ import traceback
from io import BytesIO
from decimal import Decimal
from urllib.parse import urlparse
from youtube_dl import YoutubeDL
try:
from yt_dlp import YoutubeDL
except Exception as e:
print(f'Failed to import yt_dlp due to {type(e).__name__}: {e}, importing youtube_dl', file=sys.stderr)
from youtube_dl import YoutubeDL
from . import session, config, client, seen_videos
from .utils import update_seen_videos, get_video_list
from .cappedio import bopen

2
requirements.txt

@ -1,4 +1,4 @@
youtube-dl
yt-dlp
feedparser
telethon
aiohttp

Loading…
Cancel
Save