I used to subscribe new podcasts by calling "rhythmbox [url of podcast]", but that is no longer working due to this bug. It just opens Rhythmbox instead of opening and subscribing. (although it does pre-fill it if you happen to click "add" in the podcast section)
Is there some new way GTK3 apps are supposed to communicate with each other, or is there just no way for an app to simply tell Rhythmbox to subscribe a certain podcast?
Update: Looking at an answer here I found the following with a lot of tab key in iPython:
from gi.repository import RB
....
In [2]: RB.PodcastManager.insert_feed_url
Out[2]: gi.FunctionInfo(insert_feed_url)
In [3]: RB.PodcastManager.insert_feed_url('http://feeds.feedburner.com/NodeUp')
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-3-b6415d6bfb17> in <module>()
----> 1 RB.PodcastManager.insert_feed_url('http://feeds.feedburner.com/NodeUp')
TypeError: insert_feed_url() takes exactly 2 arguments (1 given)
This seems like the right API, but what are the arguments? Will it work in systems pre-GTK3?
Update Going through the Python api here, I think I almost have it:
from gi.repository import RB
mypod = RB.PodcastChannel() #Creates blank podcast object
RB.podcast_parse_load_feed(mypod, 'http://wpdevtable.com/feed/podcast/', False)
#loads mypod.url, mypod.description etc.
RB.PodcastManager.add_parsed_feed(mypod); #fails
It appears the documentation on add_parsed_feed is incorrect, and wants 2 arguments, not 1. I know internally class' functions are defined with def thing(self, firstarg)
, is this causing a problem here with Python bindings to Rhythmbox somehow? Why can I not add the parsed podcast into Rhythmbox?
You need to instantiate the
PodcastManager
object before you calladd_parsed_feed
, so thatself
will be implicitly provided as the first argument:or
When you call it this way, the
add_parsed_feed
method is bound to theRB.PodcastManager
instance you created. When you call a bound method, the instance it's bound to (manager
, in this case) will automatically be provided as the first argument (which will end up beingself
inside ofadd_parsed_feed
)..On the other hand, when you call
RB.PodcastManager.add_parsed_feed
, theadd_parsed_feed
method isn't bound to any instance ofRB.PodcastManager
, so Python can't automatically provide that instance as the first argument. That's why you get the error about only one argument being provided.Edit:
Note that it doesn't look like using this API works properly; it always seems to segfault for me, even if I use it from the Python console embedded into Rhythmbox. Getting the behavior you want is actually really easy if you don't mind editing the Rhythmbox source code and building it yourself - it's just a one line change. In
shell/rb-shell.c
, in therb_shell_load_uri
function, change this line:To this:
Then rebuild. Now, when you include a podcast URI when you start rhythmbox, it will subscribe to the feed and start playing.
Here's the change in patch form: