Skip to content

Commit 7f3d1fd

Browse files
author
Bram de Jong
committed
Bookmark example now works like it should...
1 parent 9dba8cc commit 7f3d1fd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

download_bookmarks_example.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,23 @@
2222
except:
2323
pass
2424

25-
user = freesound_client.get_user("frederic.font")
25+
user = freesound_client.get_user("apitest")
2626
print "Username:", user.username
2727

2828
bookmarks_results_pager = user.get_bookmark_categories(page_size=100)
2929
print "Num categories:", bookmarks_results_pager.count
3030

3131
for bookmark in bookmarks_results_pager:
32-
# we have to parse the bokmark category from the sound URL
33-
bookmark_category = bookmark.sounds.split('/')[7]
34-
3532
print "\tCategory:", bookmark.name
3633
print "\tNum sounds:", bookmark.num_sounds
3734

3835
sounds_results_pager = user.get_bookmark_category_sounds(
39-
bookmark_category,
36+
bookmark.id,
4037
fields="id,name,type",
4138
page_size=1
4239
)
4340

44-
while sounds_results_pager.results:
41+
while True:
4542
for sound in sounds_results_pager:
4643
print "\t\tDownloading:", sound.name
4744

@@ -53,4 +50,7 @@
5350

5451
sound.retrieve(path_name, name=filename)
5552

53+
if not sounds_results_pager.next:
54+
break
55+
5656
sounds_results_pager = sounds_results_pager.next_page()

0 commit comments

Comments
 (0)