Feature #713

Add optional "url_helper" script (config file option) for playing streams that need "help" to play

Added by Jim Turner 7 days ago. Updated 4 days ago.

Status:Rejected Start date:March 20, 2017
Priority:Minor Due date:
Assignee:- % Done:

0%

Category:-
Target version:-
Affects version:

Description

Let's try this again! I requested (rejected) Feature# 698 to add ability to play "tunein.com" streams using a "helper" script. I've REVISED this to make it completely general (as opposed to special request for "random website" tunein.com). This simply allows the user to create a script or program to handle these types of urls on his own and provide the correct url to Audacious with minimal changes to Audacious itself and no effect for the rest of Audacious users that do not create such a script. This can greatly expand Audacious's playing capabilities with only a fairly trivial code change, (As I mentioned previously, I want to continue to make maturing Fauxdacious features available for optional mainline consideration / revisions).

Attached, please find the diff for the single file changed in Audacious (libaudcore/playlist-files.cc) along with a link to my current "contrib" script that shows how the user can modify to his own desire.

https://github.com/wildstar84/fauxdacious/blob/master/contrib/FauxdaciousUrlHelper.pl

It currently handles tunein.com, iheart.com (IHeartRadio), youtube, and vimeo, NOTE: This particular script does take advantage of some tagging features that would be simply ignored in mainline Audacious. The new Audacious option to use such a script/program is: [Audacious].url_helper=<path/to/script>

Regards,

Jim

playlist-files.diff Magnifier (3.2 kB) Jim Turner, March 20, 2017 20:07

playlist-files.cc.diff Magnifier - diff -u (106 Bytes) Jim Turner, March 22, 2017 04:34

playlist-files.cc Magnifier - Latest Fauxdacious version (7.2 kB) Jim Turner, March 22, 2017 04:34

History

#1 Updated by John Lindgren 6 days ago

Please use unified diff format. It's not easy to see what you changed without context.

#2 Updated by John Lindgren 6 days ago

  • Status changed from New to Rejected
system ((const char *) str_concat ({url_helper, " ", filename, " ", aud_get_path (AudPath::UserDir)}));
Hell no. Executing of a system call with unsanitized, unquoted, unescaped user input screams security hole.

#3 Updated by Jim Turner 6 days ago

Ok. I wasn't sure if it would make sense. Pbm. is that I haven't (yet) attempted to merge your latest "playlist" commits, so I'm diffing against a slightly older Audacious version. I've also attached my latest version, which may help.

Jim

#4 Updated by John Lindgren 4 days ago

Your second diff got messed up somehow (it's only 106 bytes) but I can see the changes from the full file. Thanks.

My earlier comment was a bit brusque and I apologize for that. I do appreciate the creativity of this solution, but I don't think this change should be included in Audacious. If we were going to implement a URL "translation" feature, I would want to see it done with a proper plugin, not by hacking up libaudcore to execute some Perl script. I think it could be done by adding an isOurPlaylist() function to the PlaylistPlugin class to treat a "special" URL as a playlist, then loading that "playlist" through the normal PlaylistPlugin::load() method. I'm not saying I'd want to maintain such a plugin in-tree, but I would be okay with adding the API to support it.

#5 Updated by Jim Turner 4 days ago

Thanks John for the suggestion on how to better do this. Working on Audacious is always a big learning experience for me as I only know the "tip of the iceberg" on this thing, so everything I do is a trial and error approach for me, so I'm always open to advice from the guru. I should pbly pay a lot more attention to security as well. As a fellow techie, no pbm. - I'm pretty used to both getting and giving brusque, to the point comments. You're pretty tame compared to some of the things Linus Torvalds says among kernel devs!

Cheers,

Jim

Also available in: Atom PDF