Skip to content

Commit

Permalink
Add extract_flat option to yt-dlp config to reduce API calls
Browse files Browse the repository at this point in the history
  • Loading branch information
AliOsm committed Nov 1, 2024
1 parent 7a903d3 commit 4a20b7d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tafrigh/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,21 @@ def __init__(self, playlist_items: str, output_dir: str):

def _config(self, download_archive: str | bool) -> dict[str, Any]:
return {
'quiet': True,
'verbose': False,
'format': 'bestaudio',
'download_archive': download_archive,
'extract_audio': True,
'outtmpl': os.path.join(self.output_dir, '%(id)s.%(ext)s'),
'extract_flat': True,
'format': 'bestaudio',
'ignoreerrors': True,
'download_archive': download_archive,
'outtmpl': os.path.join(self.output_dir, '%(id)s.%(ext)s'),
'playlist_items': self.playlist_items,
'postprocessors': [
{
'key': 'FFmpegExtractAudio',
'preferredcodec': 'mp3',
},
],
'quiet': True,
'verbose': False,
}

def download(self, url: str, retries: int = 3, save_response: bool = False) -> dict[str, Any]:
Expand Down

0 comments on commit 4a20b7d

Please sign in to comment.