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
a7dd4601
Commit
a7dd4601
authored
Jan 25, 2017
by
Fjen Undso
Browse files
fix paging
parent
966fc7ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
mopidy_youtube/backend.py
View file @
a7dd4601
...
...
@@ -94,16 +94,16 @@ class YouTubeLibraryProvider(backend.LibraryProvider):
query
=
{
'part'
:
'id,snippet'
,
'fields'
:
'nextPageToken,items(snippet(resourceId(videoId)))'
,
'maxResults'
:
maxresults
,
'maxResults'
:
50
,
'playlistId'
:
id
,
'key'
:
yt_key
,
'pageToken'
:
page
,
}
results
=
session
.
get
(
yt_api_endpoint
+
'playlistItems'
,
params
=
query
).
json
()
[
'items'
]
for
res
in
results
:
params
=
query
).
json
()
for
res
in
results
[
'items'
]
:
video_ids
.
append
(
res
[
'snippet'
][
'resourceId'
][
'videoId'
])
page
=
results
[
'nextPageToken'
]
or
None
page
=
results
.
get
(
'nextPageToken'
)
or
None
return
self
.
_get_tracks
(
video_ids
)
def
_get_search
(
self
,
query
,
maxresults
=
20
):
...
...
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