mirror of
https://github.com/KevinMidboe/spotify-downloader.git
synced 2026-02-13 04:49:27 +00:00
Filter out items other than videos in search (#249)
This commit is contained in:
committed by
Ritiek Malhotra
parent
f943080edb
commit
4ad77de97f
@@ -82,6 +82,8 @@ def generate_youtube_url(raw_song, meta_tags, tries_remaining=5):
|
|||||||
log.debug('query: {0}'.format(query))
|
log.debug('query: {0}'.format(query))
|
||||||
|
|
||||||
data = pafy.call_gdata('search', query)
|
data = pafy.call_gdata('search', query)
|
||||||
|
data['items'] = list(filter(lambda x: x['id'].get('videoId') is not None,
|
||||||
|
data['items']))
|
||||||
query_results = {'part': 'contentDetails,snippet,statistics',
|
query_results = {'part': 'contentDetails,snippet,statistics',
|
||||||
'maxResults': 50,
|
'maxResults': 50,
|
||||||
'id': ','.join(i['id']['videoId'] for i in data['items'])}
|
'id': ','.join(i['id']['videoId'] for i in data['items'])}
|
||||||
|
|||||||
Reference in New Issue
Block a user