Sign up here and you can log into the forum!

UMSP Plugin: Cantio

UMSP Plugin Depot, the place for sharing plugins & info about them. No requests, just plugins/code.

UMSP Plugin: Cantio   

Postby mad_ady » Wed Sep 07, 2011 12:05 am

Hello everyone,

I've just released the first version of the Cantio UMSP plugin. This plugin is integrated with the http://cant.io website, which is a clone of Grooveshark with the distinction that it gets the music from youtube (as music videos!) and is generally more legitimate than Grooveshark. The website shows a lot of promise, although, as far as I see, the community is not that big yet. You might not be able to find all the music you want, and you might get wrong videos (or very low quality) for specific tracks.

This plugin requires that you have Youtube Subscriptions installed on your system (Addons Manager -> UMSP)! Youtube Subscriptions proxy is used for playback. You don't need to enable Youtube Subscriptions in WEC or to have it configured. Playback quality will try to respect the selected YOUTUBE_QUALITY parameter (if available)

Plugin features:
Code: Select all
* Get most popular songs from Cant.io or Last.fm
* Get most popular artists + albums from Cant.io or Last.fm
* Canned search (defined in a config file)
* Local M3U playlists parsing
* Multiple accounts (local accounts, not connected with facebook!)
* Radio mode
* Playlists/Now playing/Favorites
* Search
* Get videos directly from Youtube


Problems/limitations:
Code: Select all
* Login is IN CLEAR TEXT - so you'd better not reuse that password anywhere else! This is how their website works, nothing I can do to change it.
* Facebook login is not implemented (don't have a facebook account :P). If anywone wants to add support, feel free.
* Radio mode is slow. When entering radio mode, the plugin asks for x random tracks to play, but the server-side script takes about 2-3 seconds to return each result. The problem is - the wdtv will time out waiting for reply if I request a lot of tracks in one go, so I've limited the number of items in the radio 'playlist' to 10. It can be tweaked in the web interface, but if you get "no content", you've asked for too many items.


If you experience problems with the plugin (some things work on the web interface, but don't work in the plugin), post here and let me know.[del]If you have complaints that certain tracks are not found, or that clip quality is awful or it's the wrong clip, then complain to the site webmasters: http://cant.io/contact//del. Recent changes have moved much of the logic behind cant.io to this plugin. If you are getting different results than on the site, let me know.

The plugin works without a configuration file, but is limited only to Most popular songs and most popular artists. In order for the plugin to be useful you should create a test account with cantio (! mind the password !) and organize your playlists as desired from there (they also have a m3u import option, but it isn't very reliable).
The configuration file gives you access to your accounts and also to radio mode (Radio mode works for registered users).
Here is an example configuration file (cantio.xml). You can place it in /conf, or on a USB drive or on an xmount; just make sure you specify the full path to reach the file in the plugin configuration section on the web interface.

Code: Select all
<?xml version="1.0"?>
<cantio>
  <canned_search>
    <item artist="1">queen</item>
    <item>scorpions</item>
    <item>kate nash</item>
  </canned_search>
  <playlist>
    <item>/conf/my playlist.m3u</item>
   <item>/tmp/mnt/1234-5678/my playlist2.m3u</item>
    <item>http://192.168.1.10/remote_playlist.m3u</item>
  </playlist>
  <account>
    <username>mad_ady@yahoo.com</username>
    <password>mysecretpassword</password>
  </account>
  <account>
    <username>other_account@yahoo.com</username>
    <password>mysecretpassword2</password>
  </account>
</cantio>


When you define a "canned search" item, you can put in your search term, or add the attribute artist=1 (like in the queen example). This will cause the plugin to interpret your query term as an artist and return all the albums of that artist, so you can browse for music. Without that attribute set, it will do a regular search.

The playlist tag allows you to define local (or remote playlists). Input the full path (or URL) to the M3U file. Please note that only Extended M3U format is supported http://en.wikipedia.org/wiki/M3U#Extended_M3U_directives. From it, the plugin will extract the artist and track and will pass along the information to youtube. If the track doesn't have metadata (the entry has the text None), then the artist and track name is derived from the filename. You don't need to have access to the files in the playlist - all the content will be taken from youtube.

The web interface also allows you to randomize the order of the tracks for playlists, now playing and favorites. It will resort the list each time you view the list.

Possible bugs:
* it's possible you won't be logged in if you're using special characters in your password (let me know if this is the case)

Let me know how it works, and post back any problems or bugs you run into.
Last edited by mad_ady on Wed Oct 19, 2011 8:29 am, edited 3 times in total.
User avatar
mad_ady
Developer
 
Posts: 3002
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: UMSP Plugin: Cantio   

Postby nicandmih » Wed Sep 07, 2011 7:08 am

tnk`s WD for the Box
tnk`s Cantio for site
tnk`s b-rad for wdlxtv time
tnk`s b-rad for firmware
tnk`s RMerlin for WEC
tnk`s Zoster for umsp
tnk`s recliq for programming
tnk`s Anyone else out there I missed!!!



tnk`s MAD_ADY for the best plugin,
nicu,
nicandmih
Donor
 
Posts: 269
Joined: Sun Apr 11, 2010 10:46 am
Location: Romania, Constanta

Re: UMSP Plugin: Cantio   

Postby mad_ady » Wed Sep 07, 2011 9:31 pm

:lol:
First happy user I've seen so far... Clearly Nicu, you haven't used the plugin too much - you would have seen that some videos are plain wrong. I have e-mailed the cant.io team to ask them how they can be fixed (if they have a user page to recommend a better video). I haven't heard from them yet.

Oh, one more thing - if you talk to the cant.io guys, don't mention this plugin. I am sure I am not supposed to use their services the way I am in order to get the content... Wouldn't want them to start changing their site because of this.
User avatar
mad_ady
Developer
 
Posts: 3002
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: UMSP Plugin: Cantio   

Postby passatgt » Mon Sep 26, 2011 11:29 am

mad_ady wrote::lol:
First happy user I've seen so far... Clearly Nicu, you haven't used the plugin too much - you would have seen that some videos are plain wrong. I have e-mailed the cant.io team to ask them how they can be fixed (if they have a user page to recommend a better video). I haven't heard from them yet.

Oh, one more thing - if you talk to the cant.io guys, don't mention this plugin. I am sure I am not supposed to use their services the way I am in order to get the content... Wouldn't want them to start changing their site because of this.


Too late for that, haha:) I created the Cantio site. You make a huge traffic with this plugin, but its ok for a while, maybe we can figure out something later that might be positive for both of us.
passatgt
n00b
 
Posts: 2
Joined: Mon Sep 26, 2011 11:27 am

Re: UMSP Plugin: Cantio   

Postby b-rad.cc » Mon Sep 26, 2011 11:33 am

well hello there 8-) :lol:
PM's are for private matters only, please post public matters on the forum to help others who might have the same issue.
:mrgreen:
User avatar
b-rad.cc
WDLXTV Team
 
Posts: 3002
Joined: Sat Apr 03, 2010 9:35 am
Location: New York

Re: UMSP Plugin: Cantio   

Postby mad_ady » Mon Sep 26, 2011 9:53 pm

Busted... :oops:

Sure, I am open to suggestions on how to reduce traffic to your site. Wouldn't want to bring your service down :)
If you want, we can talk about some simple API so that this plugin won't have to download the html pages and do scraping. I'm up for testing...

By the way, great job on the site. Especially the search engine which converts the song artist - title combination to youtube video ids :)
If you will allow me a critical suggestion - you should rethink the user login screen - sending the password in clear text (and storing it in cleartext) is not ok for the 21st century. You should consider at least sending md5 hashes from the browser or using SSL to prevent eavesdropping.

If I may ask - how did you track us down? I'm pretty sure I haven't left anything that points back to wdlxtv in the queries I make... Did google blow the whistle on us? And how much traffic is "huge"? We don't have stats of what our community likes to watch, so I assumed interest was minimal...

:)

@b-rad: I hope you're working on a small army of lawyers to protect the community's interests when the other plugin content providers show up... :lol:
User avatar
mad_ady
Developer
 
Posts: 3002
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: UMSP Plugin: Cantio   

Postby blachanc » Tue Sep 27, 2011 7:58 am

mad_ady wrote:Busted... :oops:
@b-rad: I hope you're working on a small army of l*******s to protect the community's interests when the other plugin content providers show up... :lol:


mad_ady
do not invoke the demon :-)

-Ben
blachanc
Patron
 
Posts: 200
Joined: Tue Feb 22, 2011 7:10 am
Location: Montreal,QC, Canada (french)

Re: UMSP Plugin: Cantio   

Postby passatgt » Tue Sep 27, 2011 11:04 am

mad_ady wrote:Busted... :oops:

Sure, I am open to suggestions on how to reduce traffic to your site. Wouldn't want to bring your service down :)
If you want, we can talk about some simple API so that this plugin won't have to download the html pages and do scraping. I'm up for testing...

By the way, great job on the site. Especially the search engine which converts the song artist - title combination to youtube video ids :)
If you will allow me a critical suggestion - you should rethink the user login screen - sending the password in clear text (and storing it in cleartext) is not ok for the 21st century. You should consider at least sending md5 hashes from the browser or using SSL to prevent eavesdropping.

If I may ask - how did you track us down? I'm pretty sure I haven't left anything that points back to wdlxtv in the queries I make... Did google blow the whistle on us? And how much traffic is "huge"? We don't have stats of what our community likes to watch, so I assumed interest was minimal...

:)

@b-rad: I hope you're working on a small army of lawyers to protect the community's interests when the other plugin content providers show up... :lol:


I am asking my developer tomorrow about this password thing, but i am pretty sure that we encode the password in the database.

I found this site by google, nothing special there:)

About the search engine. We use the last.fm search api. I think it would be better for you if you just use that too. More info here: http://www.last.fm/api/show?service=286
After that, when you click on the track, we just make a search with the youtube database, (trackname+artist), and here we go, we have the video. That simple. (Well, not that simple, because most of the big publishers are banning us, like VEVO and UMG, and we have to make another query on each of the result to see if its allowed to use or not. Thats why is a little slow when you play a track, but sadly we cant do much about it)
passatgt
n00b
 
Posts: 2
Joined: Mon Sep 26, 2011 11:27 am

Re: UMSP Plugin: Cantio   

Postby mad_ady » Tue Sep 27, 2011 10:10 pm

Thank you for the information. I will look into the lastfm API and think about how to change the plugin to reduce load to your site. I would still leave integration with your site - in order to get playlists, and radio mode - if that's ok with you. It would be much simpler for our users to create and manage their playlists with your site and just view/listen to the content with the media player.

Regarding the youtube search - if it's not a secret - what does it actually do? Are you just searching for an artist - track combination using the youtube API? Do you keep an internal database with cached results? Do you clean the results in other ways? (if it's secred and wouldn't want the whole internet to know it, you can PM me and I will keep my mouth shut).
I could replicate the youtube search as well (and reduce the load on your site and servers) if the search algorithm is as simple as I described it. I am worried I will run into inconsistencies - you might get video A on your site and video B on the media player for the same track.

The main problem I noticed is using radio mode. On your site it's ok - you can ask for a new track once the old one has played. On the mediaplayer I must build a playlist beforehand. Generating random tracks takes time (and I suppose uses resources on your server). This too can be improved. I will look at last.fm to see if I can get random tracks based on genre.

Well, thank you for your help so far, and for being open-minded and not wanting to throw a wrench in the works. :)
User avatar
mad_ady
Developer
 
Posts: 3002
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: UMSP Plugin: Cantio   

Postby mad_ady » Wed Sep 28, 2011 12:41 am

One more thing. I've had a look over the API and have some question on how you do things:

1. The search function: you can take either Artist, Trackname or Artist + Trackname. The Last.fm API has track.search and artist.search. Do you use some kind of logic to determine when you have to use one or the other, or do you supply the searchterm to track.search?
2. The radio function: how do you generate random tracks? Do you start with a seed track from each genre and do a track.getSimilar? The radio function of last.fm seems to be for paying members only.

Again, if my questions are too aggressive or if you don't wish everybody to know how it's done PM me please.
Oh, one more thing... The plugin is released as open-source and anybody can browse the code. If you do disclose information and it makes it into the plugin, it will be technically "public information".

Thanks again.
User avatar
mad_ady
Developer
 
Posts: 3002
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Next

Return to UMSP Plugins

Who is online

Users browsing this forum: No registered users and 1 guest