Skip to content

Commit

Permalink
Allow multiple_formats for all sites (fixes twitter progress display)
Browse files Browse the repository at this point in the history
+ Disable some log spam
  • Loading branch information
NikitaBeloglazov committed Nov 22, 2024
1 parent 5ca88b2 commit fe19f2b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/ytcon/app_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def get_pypi_version(self):
""" Get newest version number via PyPI public API """
try:
temp1 = requests.get("https://pypi.org/pypi/ytcon/json", timeout=20).json()
logger.debug(pprint.pformat(temp1))
#logger.debug(pprint.pformat(temp1))
self.pypi_version = temp1["info"]["version"]
#self.pypi_version = "0.0.14"
except:
Expand Down
2 changes: 1 addition & 1 deletion src/ytcon/downloader/hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def hook(d):
d["info_dict"]["fragments"] = []
# - = - = - = - = - = - = - = - = - = - = -

logger.debug(pprint.pformat(d))
#logger.debug(pprint.pformat(d))
if "multiple_formats" in variables.queue_list[d["info_dict"]["original_url"]]:
indexx = d["info_dict"]["original_url"] + ":" + d["info_dict"]["format_id"]
else:
Expand Down
8 changes: 4 additions & 4 deletions src/ytcon/downloader/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def downloader(url, playlist_redirect=False): # pylint: disable=too-many-return-
del infolist["thumbnails"]
if "heatmap" in infolist:
del infolist["heatmap"]
#logger.debug(pprint.pformat(infolist))
logger.debug(pprint.pformat(infolist))
# - = - = - = - = - = - = - = - = - = - = -

# - Playlists support - = - = - = - = - = - = - = - = - = - = - = - = - = - = -
Expand Down Expand Up @@ -103,12 +103,12 @@ def downloader(url, playlist_redirect=False): # pylint: disable=too-many-return-

# - = - = - = Set parameters = -
multiple_formats = False
if infolist["extractor"] == "youtube" and "requested_formats" in infolist:
multiple_formats = True
if "requested_formats" in infolist: # and infolist["extractor"] == "youtube" (also happens on twitter)
multiple_formats = True # P.S. I DON'T KNOW can this be allowed by DEFAULT for any sites, if there are some bugs, please create an issue!!!!

temp1_index = map_variables.main(multiple_formats, infolist, filename)

if exists:
if exists: # TODO move to map_variables.py?
variables.queue_list[infolist["original_url"]]["status"] = "exists"
if multiple_formats:
for i in infolist["requested_formats"]:
Expand Down

0 comments on commit fe19f2b

Please sign in to comment.