akrennmair / newsbeuter

Newsbeuter is an open-source RSS/Atom feed reader for text terminals.
http://www.newsbeuter.org/
MIT License
780 stars 100 forks source link

Podbeuter shouldn't be the only way to consume podcasts with Newsbeuter #425

Open ghost opened 8 years ago

ghost commented 8 years ago

I've noticed that when opening feeds in the browser from the main feeds page, newsbeuter usually opens the homepage of the website. Is it possible to configure newsbeuter to open the rss feed instead?

Minoru commented 8 years ago

No. What is the use-case for this?

ghost commented 8 years ago

One of my main uses for newsbeuter is browsing podcasts and casting them to my kodi box. When the item link refers to an mp3, it's easy enough to cast the item directly from newsbeuter, but I often need to open firefox and cast the file from there. Depending on the websites layout, this can be a rather clunky process so I prefer to open the simpler RSS feed in the browser. I can access the RSS feed from the individual feeds section, so it's no big deal, just wondering if there was a configuration option I was missing.

Minoru commented 8 years ago

When the item link refers to an mp3, it's easy enough to cast the item directly from newsbeuter, but I often need to open firefox and cast the file from there.

I'm not familiar with Kodi Box (quick skim of Wikipedia didn't help), so can you explain a bit more? I don't think I'm going to add an option that will let users open feeds in browser, but I'd really like to know why you need the browser at all. I mean, I got it that "casting" from browser is easier in some cases, but I want to know what "casting" even is, how you do it from Newsbeuter, and why you can't do it for some files (and thus have to open the feed in the browser)?

ghost commented 8 years ago

Sorry, my terminology might be a little imprecise.

I have an Wetek Android TV Box ( http://wetek.com/product/wetek-core ) running the KODI media center ( https://en.wikipedia.org/wiki/Kodi_(software) ) which is attached to my television/stereo system. I prefer to open videos and podcasts in KODI so I can listen to them through my stero system. Using a command line program like idok ( https://github.com/metal3d/idok ), I can easily send (cast) files located on my computer or the internet to be played on KODI. Since I spend a large portion of my time in newsbeuter, it's convenient to be able to play podcast files in KODI by setting up a macro key to set idok as my browser (, + i).

Unfortunately, this only works correctly when a item's Link refers directly to an mp3 file ( http://podcast.c-span.org/podcast/WT20161115.mp3 ) rather than a page containing the file ( http://99percentinvisible.prx.org/2016/11/15/236-reverb ), in which case I need to open the link in Firefox and send the file to KODI from there using idok via the Open With... extension. In which case, it's more convenient to open the RSS feed since all of the mp3 items for the feed are located on a single page.

In any case, it's easy enough to access the rss feed from the header of the feeds' page. Although I have noticed that some feeds do open directly to the RSS pages and some open the homepage, I'm guessing this is based on information provided by the feed rather than a feature of newsbeuter?

Minoru commented 8 years ago

Sorry, my terminology might be a little imprecise.

Oh, I put "casting" into quotes not because it's wrong terminology, but because I didn't know what that means and wanted to draw attention to it.

Although I have noticed that some feeds do open directly to the RSS pages and some open the homepage, I'm guessing this is based on information provided by the feed rather than a feature of newsbeuter?

Yes, your guess is correct. Feeds include links, usually to the sites they originate from; Newsbeuter just opens those in the browser.

Unfortunately, this only works correctly when a item's Link refers directly to an mp3 file

Oh, I see. This is an interesting way to link to MP3s; usually people use so-called "enclosures" to list related media. In Firefox, enclosures are displayed in a colourful box at the end of the article.

Newsbeuter supports them, too: you can press e to add the enclosure to ~/.newsbeuter/queue file, which you can later process with Podbeuter. I'm sorry to say this is an under-developed part of the program and we don't currently give it much attention, but I think you aren't the only person out there who wants to listen to podcasts via their Kodi.

Thanks for explanations! I'm going to rename the issue and keep it as a reminder of a use-case that I'd like to cover better in one of the future versions.

ghost commented 8 years ago

I suppose the simplest solution would be for newsbeuter to be able to pass the "Podcast Download URL" to an alternative application in a similar way that it passes "Link" to an alternative browser. This would allow the user to directly open the media file in an alternative player like kodi, mpv, mpd etc, or even pass the files to an alternative downloader like uget, which would be handy for downloading podcasts.

Dabsen commented 7 years ago

In the meantime, here is a workaround I am using to pass the podcast url to mplayer (to stream podcasts mp3 directly instead of downloading them). You could adapt it to send the url to idok. I am using a macro

macro e open ; enqueue ; set browser "play_podcast.sh" ; open-in-browser ; set browser "firefox" ; quit

which saves the podcast url to the ~/.newsbeuter/queue file, then calls my custom script (by diguising it as a browser). My script just calls mplayer on cat ~/.newsbeuter/queue then empties the queue file again.

(The first open in the macro allows me to play the podcast directly from the article list, as well.)

ghost commented 7 years ago

@Dabsen Thanks! This works great. For anyone interested my setup looks like this...

macro m open ; enqueue ; set browser "~/.newsbeuter/scripts/play_podcast_mpv.sh" ; open-in-browser ; set browser "firefox" ; quit

macro i open ; enqueue ; set browser "~/.newsbeuter/scripts/play_podcast_idok.sh" ; open-in-browser ; set browser "firefox" ; quit

with these scripts:

play_podcast_mpv.sh

mpv cat ~/.newsbeuter/queue --fs cat /dev/null >| ~/.newsbeuter/queue

play_podcast_idok.sh

idok cat ~/.newsbeuter/queue cat /dev/null >| ~/.newsbeuter/queue

The only issue I have is that mpv takes control of the console and I can't browse newsbeuter while the file is playing.

Dabsen commented 7 years ago

Does running mpv inside a new terminal solve that? For instance:

#!/bin/bash

gnome-terminal -e "mpv `cat ~/.newsbeuter/queue`"
cat /dev/null > ~/.newsbeuter/queue

It works for mplayer. Whatever terminal emulator you use should work instead of gnome-terminal (I think).

ghost commented 7 years ago

Awesome, yup I just went ahead and opened it in a new tab in my terminator session...

terminator --new-tab -x "mpv cat ~/.newsbeuter/queue --fs" cat /dev/null > ~/.newsbeuter/queue

Thanks again! This works great. Good to know newsbeuter could apparently already do what I needed.

danielpclark commented 7 years ago

I use the pipe-to feature for playing media.

In the config file I put:

macro p pipe-to "grep -o 'http.*mp3' | xargs -n1 mpv" ; toggle-article-read "read"

Then on any podcast feed description I type ,p and mpv starts playing it.

The app crashes once I exit mpv with CTRL-C if I use the --no-video flag on mpv. Normal mpv mode causes no problems.