-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaddon.py
74 lines (65 loc) · 3.15 KB
/
addon.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
from xbmcswift2 import Plugin, xbmcgui
from resources.lib import mainaddon
plugin = Plugin()
URL1 = "https://feeds.soundcloud.com/users/soundcloud:users:276623469/sounds.rss" #SPOKENEDITION
URL2 = "https://feeds.megaphone.fm/theatlanticsdailyidea" #ATLANTICSDAILYIDEA
URL3 = "https://feeds.megaphone.fm/radioatlantic" #RADIOATLANTIC
URL4 = "https://feeds.megaphone.fm/theinterview" #THEATLANTICINTERVIEW
URL5 = "https://feeds.megaphone.fm/crazygenius" #CRAZYGENIUS
@plugin.route('/')
def main_menu():
items = [
{
'label': plugin.get_string(30001),
'path': plugin.url_for('spoken_episodes'),
'thumbnail': "https://i1.sndcdn.com/avatars-000323911236-xz3vii-original.jpg"},
{
'label': plugin.get_string(30002),
'path': plugin.url_for('daily_episodes'),
'thumbnail': "https://megaphone-prod.s3.amazonaws.com/podcasts/e7243c36-77ec-11e9-b17a-7336227a9acb/image/uploads_2F1560355474940-ii2om4v0ktc-3943e9b6e78f1788e7694b9ef88f7a1b_2FAtlantic_daily_idea_3000x3000.png"},
{
'label': plugin.get_string(30003),
'path': plugin.url_for('radio_episodes'),
'thumbnail': "https://megaphone-prod.s3.amazonaws.com/podcasts/99303972-bebd-11e9-afe6-6f2c4205c3ae/image/uploads_2F1565805801785-7uakn7v7nso-00bfba516d621370e97a74945f4bea2b_2FRA-3000x3000.jpg"},
{
'label': plugin.get_string(30004),
'path': plugin.url_for('interview_episodes'),
'thumbnail': "https://cdn.theatlantic.com/assets/media/podcasts/series/2018/09/The_Atlantic_Interview/square.jpg"},
{
'label': plugin.get_string(30005),
'path': plugin.url_for('crazygenius_episodes'),
'thumbnail': "https://cdn.theatlantic.com/assets/media/podcasts/series/2019/04/CrazyGenius_Final_Cover_1/square.jpg"},
]
return items
@plugin.route('/spoken_episodes/')
def spoken_episodes():
soup1 = mainaddon.get_soup1(URL1)
playable_podcast1 = mainaddon.get_playable_podcast1(soup1)
items = mainaddon.compile_playable_podcast1(playable_podcast1)
return items
@plugin.route('/daily_episodes/')
def daily_episodes():
soup2 = mainaddon.get_soup2(URL2)
playable_podcast2 = mainaddon.get_playable_podcast2(soup2)
items = mainaddon.compile_playable_podcast2(playable_podcast2)
return items
@plugin.route('/radio_episodes/')
def radio_episodes():
soup3 = mainaddon.get_soup3(URL3)
playable_podcast3 = mainaddon.get_playable_podcast3(soup3)
items = mainaddon.compile_playable_podcast3(playable_podcast3)
return items
@plugin.route('/interview_episodes/')
def interview_episodes():
soup4 = mainaddon.get_soup4(URL4)
playable_podcast4 = mainaddon.get_playable_podcast4(soup4)
items = mainaddon.compile_playable_podcast4(playable_podcast4)
return items
@plugin.route('/crazygenius_episodes/')
def crazygenius_episodes():
soup5 = mainaddon.get_soup5(URL5)
playable_podcast5 = mainaddon.get_playable_podcast5(soup5)
items = mainaddon.compile_playable_podcast5(playable_podcast5)
return items
if __name__ == '__main__':
plugin.run()