Intro
As we all know, xiaoyuzhou is a new shining star in Chinese podcast sphere. It is known for its beautiful design and convenient functions. But due to it’s a close-circle community, we could use rss link to register podcast channel in it but could not re-generate rss link from it. Especially for the podcast which is created in xiaoyuzhou’s backend editor, we could not subscribe to them except xiaoyuzhou. So I will try to enhance its features and support export rss from it.
Exist features in RSSHub
With RSSHub, we could follow lots of platfroms’ rss sources and create a lot of rss by ourselves. RSSHub already supports two features of xiaoyuzhou
.
host/xiaoyuzhou
url will return today’s recommended list podcasts. (You should deploy your own domain and support youxiaoyuzhou
’s token in backend. )host/xiaoyuzhou/podcast/<id>
url will return a list of podcast items which corresponds to the id we provided.
That looks good. But I found that the second url’s spider use xiaoyuzhou
’s no- permission api in its html share page and it only returns the last 10 items.
Such as :
https://rsshub.app/xiaoyuzhou/podcast/6161387b0a191aa6100b4656
will return my podcast list (bingo my podcast only published 4 items.)
Enhanced RSSHub by myself
Normal Use
Let us see how to use first. I clone the official RSSHub repo and deploy my own domain in moyutime-hub.app
. If you want to get a rss page in xiaoyuzhou
, such as Gcore’s Gadio which is mostly coolest/perfessional game podcast in Chinese. Their id is 5e280fb0418a84a0461fc251
.
- If you want follow them in your local rss client , you could just subscribe to this url :
https://moyutime-hub.vercel.app/xiaoyuzhou/podcast/5e280fb0418a84a0461fc251
Rule : host/xiaoyuzhou/podcast/<pid>
- If you want to get the last
X
limits items, you could use this url instead:
https://moyutime-hub.vercel.app/xiaoyuzhou/podcast/5e280fb0418a84a0461fc251?limit=X
Rule : host/xiaoyuzhou/podcast/<pid>
?limt=X
EspeciallyX
could beall
, you can use this query flag to get all items back. But I don’t recommend using this flag for a very long podcast that the server will use a very long time to merge response and return back.
Rel=next ? ? ?
xiaoyuzhou
’s api is kind of load-more
types. So if we wanted to get all items from it, we could only request and merge response. But I looked into the RFC doc that RSS support rel=next
and rel=previcous
tag to link to next page. RFC 5005: Feed Paging and Archiving
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Example Feed</title>
<link href="http://example.org/"/>
<link rel="self" href="http://example.org/index.atom"/>
<link rel="next" href="http://example.org/index.atom?page=2"/>
<updated>2003-12-13T18:30:02Z</updated>
<author>
<name>John Doe</name>
</author>
<entry>
<title>Atom-Powered Robots Run Amok</title>
<link href="http://example.org/2003/12/13/atom03"/>
<id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
<updated>2003-12-13T18:30:02Z</updated>
<summary>Some text.</summary>
</entry>
</feed>
Thus, I support this in my folk repository. Every request to my server will return a next link ref back, such like https://moyutime-hub.vercel.app/xiaoyuzhou/podcast/5e280fb0418a84a0461fc251
return
<atom:link href="https://moyutime-hub.vercel.app/xiaoyuzhou/podcast/5e280fb0418a84a0461fc251/N4IgDgrgRgIghgFwKYgFwgEwAYMYLRYAsBhAKgIwCsqWWNWAdLVgFogA0IAlgCZogA2DISiVCGAGZIAnFiQCqPKEmxQsAYygcQPLgCck6hFwD2AO34A5AKIANUiAC+QA" rel="next" type="application/rss+xml"/>
It’s a url which combines the base url and base64 string to point to next request. But is there really a RSS client in the world that supports this RFC doc ? I have tried several clients that do not recognize it, so I turn to support limit
query phase later.
For more implement detail
Supporting this feature is pretty easy for me, so I don’t want to go into too many details about the implementation. If you are also interested in this feature, you can get more from =>
- the repo:
https://github.com/MoYuTime-Podcast/RSSHub
- the code file:
https://github.com/MoYuTime-Podcast/RSSHub/blob/feature-add-xiaoyuzhou/lib/routes/xiaoyuzhou/podcast.js