You are not logged in.

#1 2011-08-12 15:50:49

rekado
Member
From: Shanghai, China
Registered: 2009-01-13
Posts: 98
Website

soundCLI --- a console client for soundcloud.com

Hi forum,

I just packaged soundCLI for Archlinux. It is a tool I wrote to stream music from soundcloud on the command line. The cool thing about soundcloud is that timed comments can be submitted. These timed comments will be displayed automatically at the correct time when streaming music with soundCLI.

I wrote soundcli because I didn't like using the browser for every cloud-based application. SoundCLI is good enough for myself at the moment, but if you like it and would like me to implement some more features, please let me know via the github page for soundCLI.

I hope someone will find this useful.

Last edited by rekado (2011-08-16 02:45:40)

Offline

#2 2011-08-12 16:54:35

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,073

Re: soundCLI --- a console client for soundcloud.com

moving to Community Contribs


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#3 2011-08-12 18:49:17

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: soundCLI --- a console client for soundcloud.com

One of the dependencies doesn't build (ruby-gstreamer), so I can't test it at the moment. But I'll look into it, soundcli sounds promising.

edit: Ok, everything built now, but then I get this

% soundcli
/usr/lib/ruby/1.9.1/rubygems.rb:762:in `report_activate_error': Could not find RubyGem glib2 (>= 1.0.0) (Gem::LoadError)
    from /usr/lib/ruby/1.9.1/rubygems.rb:219:in `activate'
    from /usr/lib/ruby/1.9.1/rubygems.rb:254:in `block in activate'
    from /usr/lib/ruby/1.9.1/rubygems.rb:253:in `each'
    from /usr/lib/ruby/1.9.1/rubygems.rb:253:in `activate'
    from /usr/lib/ruby/1.9.1/rubygems.rb:254:in `block in activate'
    from /usr/lib/ruby/1.9.1/rubygems.rb:253:in `each'
    from /usr/lib/ruby/1.9.1/rubygems.rb:253:in `activate'
    from /usr/lib/ruby/1.9.1/rubygems.rb:1065:in `gem'
    from /usr/bin/soundcli:18:in `<main>'

What's wrong here?

Last edited by Army (2011-08-12 20:40:34)

Offline

#4 2011-08-13 00:16:12

rekado
Member
From: Shanghai, China
Registered: 2009-01-13
Posts: 98
Website

Re: soundCLI --- a console client for soundcloud.com

Thanks, I've added the missing dependency for ruby-gstreamer.
The error that you encounter is caused by the ruby-glib2 package. This seems to be outdated (it's at version 0.90.8, but the latest version is packaged as a ruby gem at version 1.0.0) and not installed as a ruby gem.

You could fix this for testing purposes by installing the glib2 gem (sudo gem install glib2), but a better would be to get the package in [community] fixed to use the gem as its source. I will contact the maintainer and see what can be done.

Offline

#5 2011-08-13 07:57:01

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: soundCLI --- a console client for soundcloud.com

Ok, I'll try to do that!

Last edited by Army (2011-08-13 08:04:42)

Offline

#6 2011-08-15 11:57:22

rekado
Member
From: Shanghai, China
Registered: 2009-01-13
Posts: 98
Website

Re: soundCLI --- a console client for soundcloud.com

I updated the PKGBUILD to make it install soundCLI from the tarball instead of the gem. I also updated the ruby-gstreamer package, so that it installs natively and doesn't require the gem.

Please let me know if a clean install of the package still causes problems.

Offline

#7 2011-08-15 12:51:30

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: soundCLI --- a console client for soundcloud.com

Are you sure that this PKGBUILD for soundcli is correct? It produces complete nonsense here.

% makepkg -sirfc
==> Making package: soundcli 0.0.2-2 (Mon Aug 15 14:50:57 CEST 2011)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving Sources...
  -> Downloading 0.0.2...
--2011-08-15 14:50:58--  https://github.com/rekado/soundCLI/tarball/0.0.2
Resolving github.com... 207.97.227.239
Connecting to github.com|207.97.227.239|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://nodeload.github.com/rekado/soundCLI/tarball/0.0.2 [following]
--2011-08-15 14:50:59--  https://nodeload.github.com/rekado/soundCLI/tarball/0.0.2
Resolving nodeload.github.com... 207.97.227.252
Connecting to nodeload.github.com|207.97.227.252|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 18959 (19K) [application/octet-stream]
Saving to: `0.0.2.part'

100%[==========================================================================================================================================================================>] 18,959      49.8K/s   in 0.4s    

2011-08-15 14:51:01 (49.8 KB/s) - `0.0.2.part' saved [18959/18959]

==> Validating source files with md5sums...
    0.0.2 ... Passed
==> Extracting Sources...
  -> Extracting 0.0.2 with bsdtar
==> Entering fakeroot environment...
==> Starting build()...
/home/army/Programme/AUR/soundcli/PKGBUILD: line 15: cd: /home/army/Programme/AUR/soundcli/src/soundcli: No such file or directory
==> ERROR: A failure occurred in build().
    Aborting...

Offline

#8 2011-08-15 13:15:10

rekado
Member
From: Shanghai, China
Registered: 2009-01-13
Posts: 98
Website

Re: soundCLI --- a console client for soundcloud.com

Argh, I tested this in an unclean directory... I'm so sorry! Will fix this tonight. (Man, that's embarrassing.)

Offline

#9 2011-08-15 13:24:58

rekado
Member
From: Shanghai, China
Registered: 2009-01-13
Posts: 98
Website

Re: soundCLI --- a console client for soundcloud.com

It's fixed now, this time for real. I've cleaned my local directory and tested the new PKGBUILD. Github gave the directory inside the tarball a funny name. I'm sorry for the trouble!

Offline

#10 2011-08-15 19:47:21

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: soundCLI --- a console client for soundcloud.com

Unfortunately

% soundcli
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- glib2 (LoadError)
	from <internal:lib/rubygems/custom_require>:29:in `require'
	from /usr/lib/ruby/site_ruby/1.9.1/gst.rb:2:in `<top (required)>'
	from <internal:lib/rubygems/custom_require>:29:in `require'
	from <internal:lib/rubygems/custom_require>:29:in `require'
	from /usr/lib/ruby/site_ruby/1.9.1/soundcli/player.rb:1:in `<top (required)>'
	from <internal:lib/rubygems/custom_require>:29:in `require'
	from <internal:lib/rubygems/custom_require>:29:in `require'
	from /usr/lib/ruby/site_ruby/1.9.1/soundcli.rb:3:in `<top (required)>'
	from <internal:lib/rubygems/custom_require>:29:in `require'
	from <internal:lib/rubygems/custom_require>:29:in `require'
	from /usr/bin/soundcli:3:in `<main>'

And it would be cool if you include the manpage, a simple

_githubcode=e88129f
...
install -Dm644 "${srcdir}/rekado-soundCLI-${_githubcode}/man/man1/soundcli.1.gz" "${pkgdir}/usr/share/man/man1/soundcli.1.gz"

will do it.

Last edited by Army (2011-08-15 19:52:03)

Offline

#11 2011-08-15 20:51:27

jomasti
Member
From: USA
Registered: 2010-08-17
Posts: 96

Re: soundCLI --- a console client for soundcloud.com

I just signed up to SoundCloud to test this out. However, when I try to enter my login information, I receive this error:

Could not post/save access token.
Could not authenticate.
/usr/lib/ruby/site_ruby/1.9.1/soundcli.rb:9:in `initialize': Authentication error (RuntimeError)
        from /usr/bin/soundcli:6:in `new'
        from /usr/bin/soundcli:6:in `<main>'

Is there something that I forgot to do?

Offline

#12 2011-08-15 23:45:41

rekado
Member
From: Shanghai, China
Registered: 2009-01-13
Posts: 98
Website

Re: soundCLI --- a console client for soundcloud.com

Army wrote:

Unfortunately

% soundcli
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- glib2 (LoadError)
	from <internal:lib/rubygems/custom_require>:29:in `require'
	from /usr/lib/ruby/site_ruby/1.9.1/gst.rb:2:in `<top (required)>'
	from <internal:lib/rubygems/custom_require>:29:in `require'
	from <internal:lib/rubygems/custom_require>:29:in `require'
	from /usr/lib/ruby/site_ruby/1.9.1/soundcli/player.rb:1:in `<top (required)>'
	from <internal:lib/rubygems/custom_require>:29:in `require'
	from <internal:lib/rubygems/custom_require>:29:in `require'
	from /usr/lib/ruby/site_ruby/1.9.1/soundcli.rb:3:in `<top (required)>'
	from <internal:lib/rubygems/custom_require>:29:in `require'
	from <internal:lib/rubygems/custom_require>:29:in `require'
	from /usr/bin/soundcli:3:in `<main>'

Did you remove the ruby-gstreamer package and reinstall it? This looks like the gem is still installed and not the new version. The gem will complain about glib2, as the ruby-glib2 package never registers as a gem.


Army wrote:

And it would be cool if you include the manpage, a simple

_githubcode=e88129f
...
install -Dm644 "${srcdir}/rekado-soundCLI-${_githubcode}/man/man1/soundcli.1.gz" "${pkgdir}/usr/share/man/man1/soundcli.1.gz"

will do it.

Hmm, the manpage is included and will be installed as ${pkgdir}/usr/share/man/man1/soundcli.1.gz by setup.rb.  Works for me(TM). Are you sure you used the latest PKGBUILD?

Offline

#13 2011-08-15 23:59:05

rekado
Member
From: Shanghai, China
Registered: 2009-01-13
Posts: 98
Website

Re: soundCLI --- a console client for soundcloud.com

jomasti wrote:

I just signed up to SoundCloud to test this out. However, when I try to enter my login information, I receive this error:

Could not post/save access token.
Could not authenticate.
/usr/lib/ruby/site_ruby/1.9.1/soundcli.rb:9:in `initialize': Authentication error (RuntimeError)
        from /usr/bin/soundcli:6:in `new'
        from /usr/bin/soundcli:6:in `<main>'

Is there something that I forgot to do?

Looks like soundcli could not write to $XDG_CONFIG_HOME/soundcli/. I should really create this directory during startup if it doesn't exist. Please create the directory and see if it works then. soundcli will fetch an authentication token from soundcloud.com and store the refresh token in the file $XDG_CONFIG_HOME/soundcli/auth.

Offline

#14 2011-08-16 00:45:31

jomasti
Member
From: USA
Registered: 2010-08-17
Posts: 96

Re: soundCLI --- a console client for soundcloud.com

That was the problem. Creating the directory fixed it. After that, I had to install the right gstreamer plugins to get it to start streaming. Maybe the -plugins packages should be added to the dependencies. Anyway, soundcli crashed 33 seconds into streaming a song, and produced this:

/usr/lib/ruby/site_ruby/1.9.1/soundcli/helpers.rb:58:in `[]=': index -1 out of string (IndexError)
        from /usr/lib/ruby/site_ruby/1.9.1/soundcli/helpers.rb:58:in `block in comment_pp'
        from /usr/lib/ruby/site_ruby/1.9.1/soundcli/helpers.rb:52:in `each'
        from /usr/lib/ruby/site_ruby/1.9.1/soundcli/helpers.rb:52:in `inject'
        from /usr/lib/ruby/site_ruby/1.9.1/soundcli/helpers.rb:52:in `comment_pp'
        from /usr/lib/ruby/site_ruby/1.9.1/soundcli/player.rb:91:in `block in play'
        from /usr/lib/ruby/site_ruby/1.9.1/soundcli/player.rb:110:in `call'
        from /usr/lib/ruby/site_ruby/1.9.1/soundcli/player.rb:110:in `run'
        from /usr/lib/ruby/site_ruby/1.9.1/soundcli/player.rb:110:in `play'
        from /usr/lib/ruby/site_ruby/1.9.1/soundcli.rb:119:in `stream'
        from /usr/bin/soundcli:15:in `call'
        from /usr/bin/soundcli:15:in `<main>'

Offline

#15 2011-08-16 02:31:31

rekado
Member
From: Shanghai, China
Registered: 2009-01-13
Posts: 98
Website

Re: soundCLI --- a console client for soundcloud.com

Ooh, nice! A first crash.
Could you please tell me the URL of the song? That's a problem in my pretty-print code for printing comments. I've never seen this with my songs before.

Yeah, the plugins... I have not yet taken the time to figure out what plugins are actually required, but I'll do this tonight when I'm home.

Thanks for testing it. Although it's a very early development version I'm using it all the time to listen to songs on soundcloud. I really want to make this work for more people than just for myself, so thanks again for the reports!

Offline

#16 2011-08-16 03:27:04

jomasti
Member
From: USA
Registered: 2010-08-17
Posts: 96

Re: soundCLI --- a console client for soundcloud.com

This is the song. It's the comment by Dj vic_x3m that caused the problem.

Offline

#17 2011-08-16 05:26:46

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: soundCLI --- a console client for soundcloud.com

rekado wrote:

Did you remove the ruby-gstreamer package and reinstall it? This looks like the gem is still installed and not the new version. The gem will complain about glib2, as the ruby-glib2 package never registers as a gem.

OOPS. Stupid mistake, sorry!

Offline

#18 2011-08-16 05:34:37

rekado
Member
From: Shanghai, China
Registered: 2009-01-13
Posts: 98
Website

Re: soundCLI --- a console client for soundcloud.com

jomasti wrote:

This is the song. It's the comment by Dj vic_x3m that caused the problem.

Wow, that sure are a lot of comments this track has! (I have been using soundCLI only on my tracks that received not nearly as many comments, so it might not be very useful with tracks that are so popular.)

I will check it tonight. The comment consists of a link only. Maybe that is what causes problems.

Offline

#19 2011-08-16 11:11:35

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: soundCLI --- a console client for soundcloud.com

rekado, I just listened to some of your tracks / watched some of your videos. Great stuff dude!!! Obviously you are a very talented musician, keep it up dude smile

Offline

#20 2011-08-16 14:20:28

rekado
Member
From: Shanghai, China
Registered: 2009-01-13
Posts: 98
Website

Re: soundCLI --- a console client for soundcloud.com

jomasti wrote:

This is the song. It's the comment by Dj vic_x3m that caused the problem.

It's fixed in git now. I also added a bunch of over stuff (configuration file, etc.).
Will create a new package for the latest git version tomorrow. (I really should work on my studies now...)

Offline

#21 2011-08-16 14:20:58

rekado
Member
From: Shanghai, China
Registered: 2009-01-13
Posts: 98
Website

Re: soundCLI --- a console client for soundcloud.com

Army wrote:

rekado, I just listened to some of your tracks / watched some of your videos. Great stuff dude!!! Obviously you are a very talented musician, keep it up dude smile

Thank you so much! I'm very happy you like it.

Offline

#22 2011-08-16 19:29:21

rejoin
Member
Registered: 2011-06-06
Posts: 43

Re: soundCLI --- a console client for soundcloud.com

Hello, I have tried the program, but this error pops up. I have reinstalled the gstreamer, entered sudo gem install glib2.

<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- gst (LoadError)
	from <internal:lib/rubygems/custom_require>:29:in `require'
	from /usr/lib/ruby/site_ruby/1.9.1/soundcli/player.rb:1:in `<top (required)>'
	from <internal:lib/rubygems/custom_require>:29:in `require'
	from <internal:lib/rubygems/custom_require>:29:in `require'
	from /usr/lib/ruby/site_ruby/1.9.1/soundcli.rb:3:in `<top (required)>'
	from <internal:lib/rubygems/custom_require>:29:in `require'
	from <internal:lib/rubygems/custom_require>:29:in `require'
	from /usr/bin/soundcli:3:in `<main>'

Offline

#23 2011-08-16 22:51:05

rekado
Member
From: Shanghai, China
Registered: 2009-01-13
Posts: 98
Website

Re: soundCLI --- a console client for soundcloud.com

rejoin wrote:

Hello, I have tried the program, but this error pops up. I have reinstalled the gstreamer, entered sudo gem install glib2.

<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- gst (LoadError)
	from <internal:lib/rubygems/custom_require>:29:in `require'
	from /usr/lib/ruby/site_ruby/1.9.1/soundcli/player.rb:1:in `<top (required)>'
	from <internal:lib/rubygems/custom_require>:29:in `require'
	from <internal:lib/rubygems/custom_require>:29:in `require'
	from /usr/lib/ruby/site_ruby/1.9.1/soundcli.rb:3:in `<top (required)>'
	from <internal:lib/rubygems/custom_require>:29:in `require'
	from <internal:lib/rubygems/custom_require>:29:in `require'
	from /usr/bin/soundcli:3:in `<main>'

How did you install that? It should be enough to install the PKGBUILD as it requires dependencies which will be installed if you run makepgk -s. There is no need to install glib2 as a gem, as it is available as a native package in [community].

Offline

#24 2011-08-17 00:12:13

rejoin
Member
Registered: 2011-06-06
Posts: 43

Re: soundCLI --- a console client for soundcloud.com

rekado wrote:
rejoin wrote:

...

...

I used cower to download it and it's dependencies- ruby-curb, ruby-gstreamer and ruby-json-all from the aur. After building all of them + soundcli + gem install glib2 i get this error..

Offline

#25 2011-08-17 02:00:19

rekado
Member
From: Shanghai, China
Registered: 2009-01-13
Posts: 98
Website

Re: soundCLI --- a console client for soundcloud.com

rejoin wrote:
rekado wrote:
rejoin wrote:

...

...

I used cower to download it and it's dependencies- ruby-curb, ruby-gstreamer and ruby-json-all from the aur. After building all of them + soundcli + gem install glib2 i get this error..

Why do you install glib2 via RubyGems? There is a proper package for it in community. If you prefer RubyGems over proper Arch packages you could of course install soundCLI as a gem, too, but this is not recommended. I only offer the gem soundcli for Mac users.

Also, make sure that you are using the latest ruby-gstreamer PKGBUILD. Right after I adopted the package, I made a mistake and uploaded a PKGBUILD which installed the gem and didn't build the native version. This has since been updated. You should not need to install any gems manually in order to use soundCLI.

Offline

Board footer

Powered by FluxBB