53 lines
857 B
Python
53 lines
857 B
Python
#!/usr/bin/python3
|
|
|
|
supported_sites = {
|
|
"apple_podcasts" : [ "podcasts.apple.com" ],
|
|
|
|
"castbox" : ["castbox.fm"],
|
|
|
|
"castro_fm" : ["castro.fm"],
|
|
|
|
"chirbit" : [
|
|
"chirbit.com",
|
|
"chirb.it"
|
|
],
|
|
|
|
"deviantart" : ["deviantart.com"],
|
|
|
|
"fyyd" : ["fyyd.de/podcast/"],
|
|
|
|
"github" : ["github.com"],
|
|
|
|
"lbry" : ["odysee.com"],
|
|
|
|
"player_fm" : ["player.fm"],
|
|
|
|
"pocketcasts" : ["pca.st"],
|
|
|
|
"reddit" : ["reddit.com"],
|
|
|
|
"soundcloud" : ["soundcloud.com"],
|
|
|
|
"tumblr" : ["tumblr.com"],
|
|
|
|
"vimeo" : ["vimeo.com"],
|
|
|
|
"youtube" : [
|
|
"youtube.com",
|
|
"youtu.be",
|
|
"yt.be",
|
|
"youtube-nocookie.com",
|
|
"youtubeeducation.com",
|
|
"youtubegaming.com",
|
|
"ytimg.com"
|
|
]
|
|
}
|
|
|
|
def determine_site (url):
|
|
site = None
|
|
for possible_site in supported_sites:
|
|
url_lower = url.lower()
|
|
for domain in supported_sites[possible_site]:
|
|
if domain in url:
|
|
return possible_site
|