Add Castbox support.
This commit is contained in:
parent
c44fcd8246
commit
04e4bfa0eb
|
@ -3,6 +3,8 @@
|
||||||
supported_sites = {
|
supported_sites = {
|
||||||
"apple_podcasts" : [ "podcasts.apple.com" ],
|
"apple_podcasts" : [ "podcasts.apple.com" ],
|
||||||
|
|
||||||
|
"castbox" : ["castbox.fm"],
|
||||||
|
|
||||||
"castro_fm" : ["castro.fm"],
|
"castro_fm" : ["castro.fm"],
|
||||||
|
|
||||||
"chirbit" : [
|
"chirbit" : [
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
#!/usr/bin/python3
|
||||||
|
|
||||||
|
from utils import *
|
||||||
|
from download_page import download
|
||||||
|
from urllib.parse import unquote
|
||||||
|
|
||||||
|
# portable code to get filename
|
||||||
|
import os
|
||||||
|
platform = os.path.basename(__file__)
|
||||||
|
if platform.endswith(".py"):
|
||||||
|
platform = platform[:(-3)]
|
||||||
|
|
||||||
|
def extract_from_page (page, verbosity):
|
||||||
|
# it's like %22%2C%22rss_url%22%3A%22https%3A%2F%2Ffeeds.npr.org%2F510310%2Fpodcast.xml%22%2C%22
|
||||||
|
# and we have to fix the codes
|
||||||
|
feed = search (page, '%22%2C%22rss_url%22%3A%22', '%22%2C%22')
|
||||||
|
if not feed is None:
|
||||||
|
return unquote(feed)
|
||||||
|
|
||||||
|
def extract (url, page=None, network=False, verbosity=3, args={}):
|
||||||
|
# cannot get feed from URL alone
|
||||||
|
if not network:
|
||||||
|
return None
|
||||||
|
|
||||||
|
page = download (platform, url, args, verbosity)
|
||||||
|
feed = extract_from_page (page, verbosity)
|
||||||
|
if not feed is None:
|
||||||
|
return feed
|
|
@ -0,0 +1,7 @@
|
||||||
|
# channel pages
|
||||||
|
https://castbox.fm/channel/id2698771 https://feeds.npr.org/510310/podcast.xml
|
||||||
|
https://castbox.fm/channel/id1238764 https://rss.art19.com/generation-why-podcast
|
||||||
|
|
||||||
|
# episode pages
|
||||||
|
https://castbox.fm/episode/Congress-Passes-Biden's-Trillion-Dollar-Transit%2C-Broadband%2C-And-Power-Bill-id2698771-id440269324 https://feeds.npr.org/510310/podcast.xml
|
||||||
|
https://castbox.fm/episode/Introducing%3A-Operator-id1238764-id440095234 https://rss.art19.com/generation-why-podcast
|
Loading…
Reference in New Issue