Skip to content

Commit

Permalink
Merge pull request #560 from admapop/fix-impersonate
Browse files Browse the repository at this point in the history
fix: impersonate property needs to be of the right type and not as it is being passed now via JSON
  • Loading branch information
alexta69 authored Dec 29, 2024
2 parents 0019d28 + bec65c3 commit 4c26fb1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/ytdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import multiprocessing
import logging
import re

import yt_dlp.networking.impersonate
from dl_formats import get_format, get_opts, AUDIO_FORMATS
from datetime import datetime

Expand Down Expand Up @@ -227,6 +229,7 @@ def __extract_info(self, url, playlist_strict_mode):
'ignore_no_formats_error': True,
'noplaylist': playlist_strict_mode,
'paths': {"home": self.config.DOWNLOAD_DIR, "temp": self.config.TEMP_DIR},
**({'impersonate': yt_dlp.networking.impersonate.ImpersonateTarget.from_str(self.config.YTDL_OPTIONS['impersonate'])} if 'impersonate' in self.config.YTDL_OPTIONS else {}),
**self.config.YTDL_OPTIONS,
}).extract_info(url, download=False)

Expand Down

0 comments on commit 4c26fb1

Please sign in to comment.