mirror of
https://github.com/KevinMidboe/spotify-downloader.git
synced 2025-10-29 09:50:16 +00:00
Skip Youtube-API-only fields when scraping
This happens because YouTube recently disabled older API keys for some reason, and so the API key being used internally in Pafy no longer works. See #671 for more information.
This commit is contained in:
@@ -109,8 +109,8 @@ def generate_metadata(content):
|
||||
"artists": [{"name": None}],
|
||||
"name": None,
|
||||
},
|
||||
"year": content.published.split("-")[0],
|
||||
"release_date": content.published.split(" ")[0],
|
||||
"year": None,
|
||||
"release_date": None,
|
||||
"type": "track",
|
||||
"disc_number": 1,
|
||||
"track_number": 1,
|
||||
@@ -122,6 +122,14 @@ def generate_metadata(content):
|
||||
"genre": None,
|
||||
}
|
||||
|
||||
# Workaround for
|
||||
# https://github.com/ritiek/spotify-downloader/issues/671
|
||||
try:
|
||||
meta_tags["year"] = content.published.split("-")[0]
|
||||
meta_tags["release_date"] = content.published.split(" ")[0]
|
||||
except pafy.util.GdataError:
|
||||
pass
|
||||
|
||||
return meta_tags
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user