Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Honeypot
mopidy-youtube
Commits
4f17fe05
Commit
4f17fe05
authored
Jan 31, 2017
by
Fjen Undso
Browse files
fix uri search
parent
a8ae59b2
Changes
1
Hide whitespace changes
Inline
Side-by-side
mopidy_youtube/backend.py
View file @
4f17fe05
...
...
@@ -79,7 +79,7 @@ class YouTubeLibraryProvider(backend.LibraryProvider):
def
_get_tracks
(
self
,
ids
):
"""Process YouTube IDs and return tracks"""
fancy_ids
=
' '
.
join
([
str
(
x
)
for
x
in
ids
])
logger
.
info
(
"Get tracks for
id
s: %s"
,
fancy_ids
)
logger
.
info
(
"Get
YouTube
tracks for
ID
s: %s"
,
fancy_ids
)
query
=
{
'part'
:
'id,snippet,contentDetails'
,
'fields'
:
'items(id,snippet(title,channelTitle,thumbnails(high(url))),contentDetails(duration))'
,
...
...
@@ -106,7 +106,7 @@ class YouTubeLibraryProvider(backend.LibraryProvider):
def
_get_playlist
(
self
,
id
,
maxresults
=
100
):
"""Process YouTube playlist and return tracks"""
logger
.
info
(
"Get
P
laylist for '%s'"
,
str
(
id
))
logger
.
info
(
"Get
YouTube p
laylist for '%s'"
,
str
(
id
))
page
=
''
video_ids
=
[]
while
page
is
not
None
and
len
(
video_ids
)
<
maxresults
:
...
...
@@ -209,7 +209,7 @@ class YouTubeLibraryProvider(backend.LibraryProvider):
logger
.
info
(
"Searching URL in YouTube '%s'"
,
search_query
)
return
SearchResult
(
uri
=
search_uri
,
tracks
=
lookup
(
search_query
)
tracks
=
self
.
lookup
(
search_query
)
)
logger
.
info
(
"Searching with youtube-dl for URL '%s'"
,
search_query
)
return
SearchResult
(
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment