IPB

Welcome Guest ( Log In | Register )

> Upload forum rules

- No over 30 sec clips of copyrighted music. Cite properly and never more than necessary for the discussion.


- No copyrighted software without permission.


- Click here for complete Hydrogenaudio Terms of Service

Playlist generator from online streams, scraping SoundCloud, YouTube
romor
post Oct 28 2011, 08:52
Post #1





Group: Members
Posts: 650
Joined: 16-January 09
Member No.: 65630



I wrote another playlist generator. This time streams are generated by search query from SoundCloud or YouTube.
It's written in Python and uses SPL, so any common Python should work, on any platform I guess wink.gif

script download

What it's supposed to do is provide access to those streams in preferred player instead browser, by providing playlists in various formats:

Usage:
CODE
python scrap.py <search term> [soundcloud] [PLS|ASX|POD|CAST|XSPF]

CODE
M3U  - Extended M3U (EXTM3U) playlist format (with title information)
PLS  - simple PLS format (with title information)
ASX  - ASX v3 (with title, links, artwork etc.)
POD  - XML podcast written to stdout (with title, links, artwork etc.)
CAST - XML podcast uploaded on server with return link for subscribing (with title, links, artwork etc.)
XSPF - XSPF format (with title, links, artwork etc.)

Arguments in square brackets are optional. It defaults to YouTube and M3U and all output is to stdout

Examples:
CODE
> python scrap.py "vainuo goths" cast
# will return URL for "subscribing" to created "podcast"
> python scrap.py dighom soundcloud > dighom.m3u && vlc dighom.m3u
#redirect output to m3u file, then open it with vlc


Both SoundCloud and YouTube parsers use regular APIs provided by services. Additionally YouTube is scraped for "hq" streams as their default gdata response does not reveal those (as expected) but only poor quality rtsp streams with 3GP files. I spent some time on improving this approach and as only/best possible solution - every item from YouTube query is parsed with partial request (24KB) to get those streams. On top of it, playlist is valid for 6h afterwhich streams wont work.

It's not throughout tested, but I want to think that script is compact and flexible. Couple of queries in all playlist formats are tested with foobar2000 and VLC successfully. Also got these for podcasts and XSPF:



--------------------
scripts: http://goo.gl/M1qVLQ
Go to the top of the page
+Quote Post
 
Start new topic
Replies
romor
post Oct 31 2011, 03:12
Post #2





Group: Members
Posts: 650
Joined: 16-January 09
Member No.: 65630



Added Grooveshark option. Script from first post updated.
Every service is accessed through valid API calls despite script name wink.gif

Usage:
CODE
python scrap.py <search term> [soundcloud|grooveshark|youtube] [PLS|ASX|POD|CAST|XSPF]



--------------------
scripts: http://goo.gl/M1qVLQ
Go to the top of the page
+Quote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 18th April 2014 - 23:17