mirror of
				https://github.com/KevinMidboe/spotify-downloader.git
				synced 2025-10-29 18:00:15 +00:00 
			
		
		
		
	Merge pull request #672 from ritiek/youtube-api-crash
Skip Youtube-API-only fields when scraping
This commit is contained in:
		| @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) | |||||||
| and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). | and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). | ||||||
|  |  | ||||||
| ## [Unreleased] | ## [Unreleased] | ||||||
|  | ### Fixed | ||||||
|  | - Skip crash when accessing YouTube-API-only fields in scrape mode ([@ritiek](https://github.com/ritiek)) (#672) | ||||||
|  |  | ||||||
| ## [1.2.4] - 2020-01-10 | ## [1.2.4] - 2020-01-10 | ||||||
| ### Fixed | ### Fixed | ||||||
|   | |||||||
| @@ -109,8 +109,8 @@ def generate_metadata(content): | |||||||
|             "artists": [{"name": None}], |             "artists": [{"name": None}], | ||||||
|             "name": None, |             "name": None, | ||||||
|         }, |         }, | ||||||
|         "year": content.published.split("-")[0], |         "year": None, | ||||||
|         "release_date": content.published.split(" ")[0], |         "release_date": None, | ||||||
|         "type": "track", |         "type": "track", | ||||||
|         "disc_number": 1, |         "disc_number": 1, | ||||||
|         "track_number": 1, |         "track_number": 1, | ||||||
| @@ -122,6 +122,14 @@ def generate_metadata(content): | |||||||
|         "genre": None, |         "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 |     return meta_tags | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user