diff --git a/universal.py b/universal.py index fca9a49..dc7a63d 100644 --- a/universal.py +++ b/universal.py @@ -1,4 +1,4 @@ -# meta developer: @origsama +# meta developer: @HoroshoVse # requires: yt-dlp from .. import loader, utils import requests @@ -9,6 +9,7 @@ import tempfile import urllib.parse import json import shutil +import sys @loader.tds class SocialDownloaderMod(loader.Module): @@ -104,7 +105,7 @@ class SocialDownloaderMod(loader.Module): output_template = os.path.join(temp_dir, '%(title)s.%(ext)s') cmd = [ - 'yt-dlp', + sys.executable, '-m', 'yt_dlp', '-f', 'best[filesize<50M]', '--max-filesize', f"{self.config['max_size']}M", '-o', output_template, @@ -141,7 +142,7 @@ class SocialDownloaderMod(loader.Module): async def get_video_info(self, url): try: - cmd = ['yt-dlp', '--dump-json', '--no-playlist', url] + cmd = [sys.executable, '-m', 'yt_dlp', '--dump-json', '--no-playlist', url] process = await asyncio.create_subprocess_exec( *cmd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE ) @@ -197,7 +198,7 @@ class SocialDownloaderMod(loader.Module): output_template = os.path.join(temp_dir, '%(title)s.%(ext)s') cmd = [ - 'yt-dlp', + sys.executable, '-m', 'yt_dlp', '-f', f'best[height<={quality}]' if quality != 'best' else 'best', '--max-filesize', f"{self.config['max_size']}M", '-o', output_template,