1 from django
.conf
.urls
import *
3 urlpatterns
= patterns('',
4 (r
'^upload$', 'mygpo.api.legacy.upload'),
5 (r
'^getlist$', 'mygpo.api.legacy.getlist'),
6 (r
'^toplist.opml$', 'mygpo.api.simple.toplist', {'count': 50, 'format': 'opml'}),
9 urlpatterns
+= patterns('mygpo.api.simple',
10 (r
'^subscriptions/(?P<username>[\w.-]+)/(?P<device_uid>[\w.-]+)\.(?P<format>\w+)', 'subscriptions'),
11 (r
'^subscriptions/(?P<username>[\w.-]+)\.(?P<format>\w+)', 'all_subscriptions'),
12 url(r
'^toplist/(?P<count>\d+)\.(?P<format>\w+)', 'toplist', name
='toplist-opml'),
13 (r
'^search\.(?P<format>\w+)', 'search'),
14 url(r
'^suggestions/(?P<count>\d+)\.(?P<format>\w+)', 'suggestions', name
='suggestions-opml'),
15 (r
'^toplist\.(?P<format>\w+)$', 'toplist', {'count': 50}),
16 url(r
'^gpodder-examples\.(?P<format>\w+)$', 'example_podcasts', name
='example-opml'),
19 from mygpo
.api
.subscriptions
import SubscriptionsAPI
20 from mygpo
.api
.advanced
.updates
import DeviceUpdates
22 urlpatterns
+= patterns('mygpo.api.advanced',
23 url(r
'^api/(?P<version>[12])/subscriptions/(?P<username>[\w.-]+)/(?P<device_uid>[\w.-]+)\.json',
24 SubscriptionsAPI
.as_view(), name
='subscriptions-api'),
26 url(r
'^api/(?P<version>[12])/episodes/(?P<username>[\w.-]+)\.json', 'episodes'),
27 (r
'^api/[12]/devices/(?P<username>[\w.-]+)/(?P<device_uid>[\w.-]+)\.json', 'device'),
28 (r
'^api/[12]/devices/(?P<username>[\w.-]+)\.json', 'devices'),
30 (r
'^api/2/auth/(?P<username>[\w.-]+)/login\.json', 'auth.login'),
31 (r
'^api/2/auth/(?P<username>[\w.-]+)/logout\.json', 'auth.logout'),
32 (r
'^api/2/tags/(?P<count>\d+)\.json', 'directory.top_tags'),
33 (r
'^api/2/tag/(?P<tag>[^/]+)/(?P<count>\d+)\.json', 'directory.tag_podcasts'),
34 (r
'^api/2/data/podcast\.json', 'directory.podcast_info'),
35 (r
'^api/2/data/episode\.json', 'directory.episode_info'),
37 (r
'^api/2/chapters/(?P<username>[\w.-]+)\.json', 'episode.chapters'),
38 (r
'^api/2/updates/(?P<username>[\w.-]+)/(?P<device_uid>[\w.-]+)\.json',
39 DeviceUpdates
.as_view()),
41 (r
'^api/2/settings/(?P<username>[\w.-]+)/(?P<scope>account|device|podcast|episode)\.json', 'settings.main'),
42 (r
'^api/2/favorites/(?P<username>[\w.-]+).json', 'favorites'),
44 (r
'^api/2/lists/(?P<username>[\w.-]+)/create\.(?P<format>\w+)', 'lists.create'),
45 (r
'^api/2/lists/(?P<username>[\w.-]+)\.json', 'lists.get_lists'),
46 url(r
'^api/2/lists/(?P<username>[\w.-]+)/list/(?P<listname>[\w-]+)\.(?P<format>\w+)', 'lists.podcast_list', name
='api-get-list'),
48 (r
'^api/2/sync-devices/(?P<username>\w+)\.json', 'sync.main'),