-
 KDE-Apps.org Applications for the KDE-Desktop 
 GTK-Apps.org Applications using the GTK Toolkit 
 GnomeFiles.org Applications for GNOME 
 MeeGo-Central.org Applications for MeeGo 
 CLI-Apps.org Command Line Applications 
 Qt-Apps.org Free Qt Applications 
 Qt-Prop.org Proprietary Qt Applications 
 Maemo-Apps.org Applications for the Maemo Plattform 
 Java-Apps.org Free Java Applications 
 eyeOS-Apps.org Free eyeOS Applications 
 Wine-Apps.org Wine Applications 
 Server-Apps.org Server Applications 
 apps.ownCloud.com ownCloud Applications 
--
-
 KDE-Look.org Artwork for the KDE-Desktop 
 GNOME-Look.org Artwork for the GNOME-Desktop 
 Xfce-Look.org Artwork for the Xfce-Desktop 
 Box-Look.org Artwork for your Windowmanager 
 E17-Stuff.org Artwork for Enlightenment 
 Beryl-Themes.org Artwork for the Beryl Windowmanager 
 Compiz-Themes.org Artwork for the Compiz Windowmanager 
 EDE-Look.org Themes for your EDE Desktop 
--
-
 Debian-Art.org Stuff for Debian 
 Gentoo-Art.org Artwork for Gentoo Linux 
 SUSE-Art.org Artwork for openSUSE 
 Ubuntu-Art.org Artwork for Ubuntu 
 Kubuntu-Art.org Artwork for Kubuntu 
 LinuxMint-Art.org Artwork for Linux Mint 
 Arch-Stuff.org Art And Stuff for Arch Linux 
 Frugalware-Art.org Themes for Frugalware 
 Fedora-Art.org Artwork for Fedora Linux 
 Mandriva-Art.org Artwork for Mandriva Linux 
--
-
 KDE-Files.org Files for KDE Applications 
 OpenTemplate.org Documents for OpenOffice.org
 GIMPStuff.org Files for GIMP
 InkscapeStuff.org Files for Inkscape
 ScribusStuff.org Files for Scribus
 BlenderStuff.org Textures and Objects for Blender
 VLC-Addons.org Themes and Extensions for VLC
--
-
 KDE-Help.org Support for your KDE Desktop 
 GNOME-Help.org Support for your GNOME Desktop 
 Xfce-Help.org Support for your Xfce Desktop 
--
openDesktop.orgopenDesktop.org:   Applications   Artwork   Linux Distributions   Documents    LinuxDaily.com    Linux42.org    OpenSkillz.com   
 
Apps
News
Groups
Knowledge
Events
Forum
People
Jobs
Register
Login


Sponsoring


-
- Content .- Fans (6) . 

Google Music for Amarok

   1.3.0  

Amarok 2.0 Script

Score 53%
Google Music for Amarok
zoom


Version Control:  Link
Minimum required   KDE 3.x and KDE 4.x
Downloads:  1138
Submitted:  Jan 27 2013
Updated:  Jul 23 2013

Description:

This script allows you to listen your music allocated in your Google Music account using Amarok.

You only need to have installed curl. Then this script do the work for you!

After installation put your account parameters and then update the list of songs. Once the list is updated you can listen your music!

== OTHER PROBLEMS ==
If you see an error related to "Parse error" try to read the ListSongs.json file and if you see a html code remove it. This file should only have json code between "{[" characters.




Changelog:

v1.3.0:
- Added search bar
- Problem with breakline in authToken
- Download all songs
v1.2.1:
- Reduced size of listSong file.
- Accept-Type in curl function when download new listSongs.
- eval function changed by JSON.parse
v1.2:
- Bash script functions passed to javascript.
v1.0:
- First script release.




LicenseLGPL
Source(Google Music for Amarok)
Send to a friend
Subscribe
Other  Apps  from jbatalle
Report inappropriate content



goto page:  1  2 

-

 Great idea, but...

 
 by mdye on: Jan 28 2013
 
Score 50%
mdyemdye
-
Matthew Dye 0

United States of America, Columbia, MO
Last visit Jan 12 2014
0 Friends
0 Groups

More info
Send a message
Add as friend
Other contents
--

Fantastic and useful idea; the only problem is it doesn't work (for me, at least). It says it's logged in, but I'm there's no real evidence that it is. And it won't populate with Google Music music - it just stops trying.


Reply to this

-

 Re: Great idea, but...

 
 by jbatalle on: Jan 28 2013
 
Score 50%

If you are logged correclty, then you need to press the update list button (in tools menu). This button download the list of songs in json file. Then you need to restart amarok. If you look the folder of the script (~./kde4/share/apps/amarok/scripts/google_music/) you may see the cookie.txt and a listSongs.json.

Is the first version of the script, and have a little problems. During these weeks I will try to improve it.


Reply to this

-

 Re: Re: Great idea, but...

 
 by mdye on: Jan 28 2013
 
Score 50%
mdyemdye
-
Matthew Dye 0

United States of America, Columbia, MO
Last visit Jan 12 2014
0 Friends
0 Groups

More info
Send a message
Add as friend
Other contents
--

It doesn't seem to be doing any of that - there's no cookies file nor is there a music list file. I've tried logging in several different ways - with and without the domain, but it doesn't seem to do anything. I've followed the instructions in the prompts - login, then update collection, then restart - and nothing. Not sure what else to do.


Reply to this

-

 Re: Re: Re: Great idea, but...

 
 by amair on: Jan 29 2013
 
Score 50%

Hi,

it didn't work for me, too.
I had make the script executable. Run "chmod +x google_music.sh" in the script's folder.

I also think that the auth() function in that script needs some changes to make it more robust and fix script errors. See that patch:
--- google_music.sh.orig 2013-01-29 08:56:06.000000000 +0100
+++ google_music.sh 2013-01-29 08:56:03.000000000 +0100
@@ -7,14 +7,15 @@
email=$1
password=$2
authResponse=$(curl "$clientLoginUrl" --data-urlencode Email="$email" --data-urlencode Passwd="$password" -d accountType=GOOGLE -d service="$service")
- authToken="${authResponse##*=}"
- SID="${authResponse:4:288}"
- LID="${authResponse:298:288}"
- return $SID
+ authToken="$(echo "$authResponse" | egrep "^Auth=" | cut -d= -f2-)"
+ SID="$(echo "$authResponse" | egrep "^SID=" | cut -d= -f2-)"
+ LID="$(echo "$authResponse" | egrep "^LID=" | cut -d= -f2-)"
+ [ "$SID" ] || return 1
+ return 0
}

function listSongs(){
- curl --header "Authorization: GoogleLogin auth=${authToken}" https://www.googleapis.com/sj/v1beta1/tracks > listSongs.json
+ curl --header "Authorization: GoogleLogin auth=${authToken}" https://www.googleapis.com/sj/v1beta1/tracks > ListSongs.json
}

function getCookie() {
@@ -55,10 +56,10 @@
auth $email $password
return_val=$?
echo $return_val>return.txt
- if [ "$?" == "" ]; then
+ if [ $return_val -ne 0 ]; then
echo "offline"
echo $return_val>return.txt
- elif [ "$?" != "" ]; then
+ else
listSongs
getCookie $email $password
fi


Best regards,
Andreas


Reply to this

-

 Re: Re: Re: Re: Great idea, but...

 
 by jbatalle on: Jan 29 2013
 
Score 50%

Hi,
thank you to apport your changes!

Once you've added execution permissions to the .sh file, then works or not?

If the unique problem is related to the .sh file, I can solve it. The following days I try to improve and include this script in javascript file, but I don't know if I can manage cookies with js.

This evening I will apply the patch and others modifications.

thank you,
Josep


Reply to this

-

 Re: Re: Re: Re: Re: Great idea, but...

 
 by amair on: Jan 29 2013
 
Score 50%

Hi,

yes, giving the script executable permission was enough to get it working.

BTW: do you know the Unofficial Google Music API (https://github.com/simon-weber/Unofficial-Google-Music-API)?
I know it's not Javascript but maybe it helps.

Best regards,
Andreas


Reply to this

-

 Re: Re: Re: Re: Re: Re: Great idea, but...

 
 by jbatalle on: Jan 29 2013
 
Score 50%

Ah, Ok!
I have read the unOfficial api and is written in python. At this moment I think is more interesting to give a script only using javascript. If I have more time, I try to use this api because give a lot of options.

At this moment I'm working including the ".sh" into javascript files. I have included the curl function inside javascript and works fine. Now I only need to adapt the commands to javascript.



-

 Helpful link

 
 by simon-weber on: Jan 30 2013
 
Score 50%

Hi, I'm the Simon mentioned below. Nice work on this!

If you haven't seen http://dpogue.ca/gmusic.html, it's worth checking out. It's got more details on the specific endpoints you're using.

As a heads up, my work uses two other different Google endpoints which probably wouldn't be very helpful to you.


Reply to this

-

 Re: Helpful link

 
 by jbatalle on: Jan 30 2013
 
Score 50%

Hi,
I read this page when I was searching information. But I had problems with Android's url and I left it.
But my works is similar, I'm based on https://developers.google.com/gdata/articles/using_cURL to get the Cookies, and then I used other url to get the songs (https://play.google.com/music/play). The problem is this url only allows listen the song one time for each provided url. For listen again I need to access another time to the get the new url.


Reply to this

-
.

 Script Parsing Error

 
 by TReed0803 on: Feb 9 2013
 
Score 50%

I love this idea! It looks like it logged me in, and even got my song info. But I get a parsing error when I run the script. Consecutive run of Amarok seems like the script kills it. Has the script been tested with a big music library? I feel this may be my issue, but I am not sure.

My ListSongs.json file is gigantic. 4.1 MB filled with many many songs (> 10,000). I'm wondering if maybe there's a limitation on how many songs the script can reasonably parse?

I will clean out my Google Music (it's filled with many old songs I don't listen to any more) and try again, but I just want to bring this to your attention if you plan on continuing this project.


Reply to this

-

 Re: Script Parsing Error

 
 by jbatalle on: Feb 10 2013
 
Score 50%

Hi,
mmm I was doing my tests with a file that has 3000 songs (2mb). Probably this is the problem, the number of songs because I tried to include a filter in order to search songs and then after few tests amarok crashes. However, I modified the script in order to reduce the size of the file, saving only the basic information.

Related of your problem, the script load the library(read the file) when you click on the Google Music for Amarok in Collection menu. Then Amarok would snap at that moment, not at the startup.

If you can give more information about the error, can help to solve it.

Thank you for your comment!


Reply to this

-

 Re: Re: Script Parsing Error

 
 by amair on: Feb 10 2013
 
Score 70%

Hi,

I had that problem when I updated to v1.2, too. I've looked into the ListSongs.json file and found some HTML code at the beginning or the end (sorry, can't remember).

Best regards,
Andreas


Reply to this

-

 Re: Re: Re: Script Parsing Error

 
 by TReed0803 on: Feb 10 2013
 
Score 63%

That was the issue, actually! After removing the html that was at the end of the ListSongs.json file, it works perfectly fine!

I'm thinking that it breaks on parsing because of this?

I tried updating again, and the HTML that I get at the end is consistent:

<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>

After removing this HTML, the script works perfectly. Thank you!


Reply to this

-

 Re: Re: Re: Re: Script Parsing Error

 
 by jbatalle on: Feb 10 2013
 
Score 50%

Oh great! But I don't understand what happens with the html code. Now I only download the list and I parse the songs, then I create a new file and I put only the json code... The html code is not parsed, then in theory should not appears inside the json file.

In my pc works fine (I don't see any html code). Furthermore, I installed the script in two versions of Amarok (2.5.0 and 2.7.0) and works fine in both.

Thank you!


Reply to this

-

 Re: Re: Re: Re: Re: Script Parsing Error

 
 by amair on: Feb 11 2013
 
Score 50%

Hi,

here it works with v1.2.1, too.

Best regards,
Andreas


Reply to this

-

 Parse error

 
 by daimadoshi85 on: Feb 10 2013
 
Score 50%

Hi!Sorry I tried to install the script on amarok now, I read your comments and tried it. I receive a parse error but the script doesn't create the file listSongs.json. Can you help me?

Thank you very much.


Reply to this

-

 Re: Parse error

 
 by jbatalle on: Feb 10 2013
 
Score 50%

Try now, I changed a function, but I don't understand what happen. Have you got strange characters in your music allocated in google?


Reply to this

-

 Re: Re: Parse error

 
 by jbatalle on: Feb 10 2013
 
Score 50%

If now doesn't work try to change the line 110 of the file lib.js. Change the

eval("var JSON_obj = " + listSongs);
to
var JSON_obj = eval( "(" + listSongs + ")" );


Reply to this

-

 Re: Re: Re: Parse error

 
 by daimadoshi85 on: Feb 11 2013
 
Score 50%

Yes, I might have some special characters in my music library. I'll try your solution this evening, thank you very much. I'll keep you updated.


Reply to this

-

 Re: Re: Re: Parse error

 
 by daimadoshi85 on: Feb 12 2013
 
Score 50%

New version worked fine!Thank you very much :)


Reply to this

-

 Parse error

 
 by quaff on: May 9 2013
 
Score 50%

I'm getting parse errors when I try to play a song from my Google Music collection. I've set up the script properly, and ListSongs.json was created properly.

I have special characters in some of my songs (Chinese), not sure if that will impact the parse error.


Reply to this

-

 Re: Parse error

 
 by quaff on: May 9 2013
 
Score 50%

Also, I have two-step authentication enabled. Not sure if that makes a difference since I was able to log in properly and retrieve a song list with an application-specific password


Reply to this

-

 Re: Re: Parse error

 
 by jbatalle on: May 13 2013
 
Score 50%

Hello,
sorry for the delay... I'm very busy these days.

How you say, I think that the problem is the characters.
If you want, give me a part of your file and I can try to find a solution.

Thank you to report the problem!


Reply to this

-
.

 SyntaxError: Parse error

 
 by FraSMOG on: Jul 6 2013
 
Score 50%

Hi,
here also I got the "Parse error" problem... I've looked at my Json code but it seems fine to me... :(
If it can help, I can send you the file via email, I don't think attach the whole file here is a good idea...


S.M.O.G. from Pimp My Linux
http://pimpmylinux.wordpress.com

Reply to this

-

 Re: SyntaxError: Parse error

 
 by jbatalle on: Jul 6 2013
 
Score 50%

Hello!
What version of Amarok are you using? In my computer with 2.5 version works fine, but in other computer (without KDE) doesn't work. This means that the problem is not in the parsing of the json file, is in the code... maybe is due to lack of libraries.

Maybe can be more useful if you can run the amarok in debugging mode (amarok --debug in a terminal), and paste here, or send me an email with the lines that show the error.


Reply to this

-

 Re: Re: SyntaxError: Parse error

 
 by FraSMOG on: Jul 6 2013
 
Score 50%

I use Amarok 2.7.1 under KDE 4.10.5

I get the list of songs (all together, not nested by any metatag, just sorted by song name) but when I try to play one of them I get that error, and the most useful thing I see in the debug is this, I think:
Quote:
SCRIPT "Google Music for Amarok" : "<HTML>
<HEAD>
<TITLE>Moved Temporarily</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Moved Temporarily</H1>
The document has moved <A HREF="https://www.google.com/accounts/ServiceLogin?service=sj&amp;passive=1209600&amp;continue=https://music.google.com/music/play?u%3D0%26songid%3Db81953d2-8795-3ecf-b3ba-1fac80bd522b%26pt%3De&amp;followup=https://music.google.com/music/play?u%3D0%26songid%3Db81953d2-8795-3ecf-b3ba-1fac80bd522b%26pt%3De">here</A>.
</BODY>
</HTML>
"


S.M.O.G. from Pimp My Linux
http://pimpmylinux.wordpress.com

Reply to this

goto page:  1  2 

Add commentBack






-
-
How do you like Plasma 5?
 The best KDE Desktop ever.
 Definitely a nice improvement.
 Not decided yet. Haven't tried it yet.
 I do not like some of the changes.
 KDE is taking the wrong way.
 I am still sticking with KDE 3.5.
 I have no opinion, but wanted to vote anyway.

resultmore
 
 
 Who we are
Contact
More about us
Frequently Asked Questions
Register
Twitter
Blog
Explore
Apps
Jobs
Knowledge
Events
People
Updates on identi.ca
Updates on Twitter
Facebook App
Content RSS   
Events RSS   

Participate
Groups
Forum
Add App
Public API
About KDE-Apps.org
Legal Notice
Spreadshirt Shop
CafePress Shop
Advertising
Sponsor us
Report Abuse
 

Copyright 2003-2014 KDE-Apps.org Team  
All rights reserved. KDE-Apps.org is not liable for any content or goods on this site.
All contributors are responsible for the lawfulness of their uploads.
KDE and K Desktop Environment are trademarks of KDE e.V.