nehm 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -0
- data/LICENSE +19 -0
- data/README.md +93 -0
- data/Rakefile +20 -0
- data/bin/nehm +3 -0
- data/lib/nehm/artwork.rb +24 -0
- data/lib/nehm/cacert.pem +3988 -0
- data/lib/nehm/client.rb +13 -0
- data/lib/nehm/config.rb +46 -0
- data/lib/nehm/configure.rb +24 -0
- data/lib/nehm/help.rb +57 -0
- data/lib/nehm/os.rb +7 -0
- data/lib/nehm/path_control.rb +48 -0
- data/lib/nehm/track.rb +49 -0
- data/lib/nehm/track_utils.rb +96 -0
- data/lib/nehm/user.rb +37 -0
- data/lib/nehm/user_control.rb +49 -0
- data/lib/nehm/version.rb +3 -0
- data/lib/nehm.rb +53 -0
- data/nehm.gemspec +29 -0
- metadata +188 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 2310de5a36aa924a6313a683e9ab745e45294615
|
4
|
+
data.tar.gz: f4e9875a9c6ff92c758ef4d90ed38882dbdda365
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 336ce7cac4a0d9fdeb3f9371e16af2344dc41202cd9296822c158f237f9a8a7073bcf5e29028694d817c42430d6e79c96a1917bc34a11ce1a9f88f0b407f9aa8
|
7
|
+
data.tar.gz: 5fe2ea9bc1643413ac3bec03458b2927db379d5850c336362e8ddeed35d56fc58b3739d5aa52bbec392c9ddf59e77b196dcce0ae5f5dbf4bb3bf3efcb9768a81
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
Copyright (c) 2015 Albert Nigmatzianov
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
11
|
+
all copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,93 @@
|
|
1
|
+
# nehm
|
2
|
+
|
3
|
+
*nehm* is a console tool, which downloads, sets IDv3 tags and adds to your iTunes library your SoundCloud posts or likes (also by url) in convenient way
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
**1. First, you should install `taglib` library**
|
8
|
+
|
9
|
+
**Mac OS X:**
|
10
|
+
|
11
|
+
`brew install taglib`
|
12
|
+
|
13
|
+
or
|
14
|
+
|
15
|
+
`sudo port install taglib`
|
16
|
+
|
17
|
+
**Linux** (depends on your package manager):
|
18
|
+
|
19
|
+
Debian/Ubuntu: ` sudo apt-get install libtag1-dev`
|
20
|
+
|
21
|
+
Fedora/RHEL: ` sudo yum install taglib-devel`
|
22
|
+
|
23
|
+
**2. Then you can install `nehm` gem:**
|
24
|
+
|
25
|
+
`gem install nehm`
|
26
|
+
|
27
|
+
**That's all!**
|
28
|
+
|
29
|
+
## First usage
|
30
|
+
|
31
|
+
If you just installed nehm, you should set it up
|
32
|
+
|
33
|
+
Write `nehm init` for it
|
34
|
+
|
35
|
+
nehm should answer like this:
|
36
|
+
```
|
37
|
+
Hello!
|
38
|
+
Before using the nehm, you should set it up:
|
39
|
+
Enter a FULL path to desirable download directory (press enter to set it to ...
|
40
|
+
```
|
41
|
+
|
42
|
+
**Now you can use nehm!**
|
43
|
+
Go to usage for further instructions
|
44
|
+
|
45
|
+
## Usage
|
46
|
+
|
47
|
+
**!!nehm doesn't add tracks to iTunes library, if you use Linux!!**
|
48
|
+
|
49
|
+
* To get (download to download directory, set tags and add to Itunes library) your last like
|
50
|
+
|
51
|
+
`nehm get like`
|
52
|
+
|
53
|
+
* To get your last post (last track or repost from your profile)
|
54
|
+
|
55
|
+
`nehm get post`
|
56
|
+
|
57
|
+
* To get multiple last posts or likes
|
58
|
+
|
59
|
+
`nehm get 3 posts` or `nehm get 3 likes`
|
60
|
+
|
61
|
+
* To just download and set tags any track, you can input
|
62
|
+
|
63
|
+
`nehm dl post` or `nehm dl like` or `nehm dl 3 likes` and etc.
|
64
|
+
|
65
|
+
* And of course you can get or download track from url
|
66
|
+
|
67
|
+
`nehm get https://soundcloud.com/nasa/delta-iv-launch`
|
68
|
+
|
69
|
+
or
|
70
|
+
|
71
|
+
`nehm dl https://soundcloud.com/nasa/delta-iv-launch`
|
72
|
+
|
73
|
+
* Also, you can configure nehm (change download directory, iTunes directory, permalink)
|
74
|
+
|
75
|
+
`nehm configure`
|
76
|
+
|
77
|
+
* For help, just input
|
78
|
+
|
79
|
+
`nehm help`
|
80
|
+
|
81
|
+
##FAQ
|
82
|
+
|
83
|
+
**Q: What is permalink?**
|
84
|
+
|
85
|
+
A: Permalink is the last word in your profile url. Example: for profile url 'soundcloud.com/qwerty' permalink is 'qwerty'
|
86
|
+
|
87
|
+
## Contributing
|
88
|
+
|
89
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/bogem/nehm.
|
90
|
+
|
91
|
+
## Links
|
92
|
+
|
93
|
+
My SoundCloud profile: https://soundcloud.com/bogem
|
data/Rakefile
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require_relative 'lib/nehm/version.rb'
|
2
|
+
task default: %w(build install delete)
|
3
|
+
|
4
|
+
file = 'nehm-' + Nehm::VERSION + '.gem'
|
5
|
+
|
6
|
+
task :build do
|
7
|
+
system('gem build nehm.gemspec')
|
8
|
+
end
|
9
|
+
|
10
|
+
task :install do
|
11
|
+
system('gem install ./' + file)
|
12
|
+
end
|
13
|
+
|
14
|
+
task :delete do
|
15
|
+
File.delete('./' + file)
|
16
|
+
end
|
17
|
+
|
18
|
+
task :push => :build do
|
19
|
+
system('gem push ' + file)
|
20
|
+
end
|
data/bin/nehm
ADDED
data/lib/nehm/artwork.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
class Artwork
|
2
|
+
def initialize(track)
|
3
|
+
@track = track
|
4
|
+
end
|
5
|
+
|
6
|
+
def file_path
|
7
|
+
id = @track.id
|
8
|
+
file_name = "#{id}.jpg"
|
9
|
+
File.join('/tmp', file_name)
|
10
|
+
end
|
11
|
+
|
12
|
+
def suicide
|
13
|
+
File.delete(file_path)
|
14
|
+
end
|
15
|
+
|
16
|
+
def dl_url
|
17
|
+
hash = @track.hash
|
18
|
+
if hash['artwork_url'].nil?
|
19
|
+
hash['user']['avatar_url'].sub('large', 't500x500')
|
20
|
+
else
|
21
|
+
hash['artwork_url'].sub('large', 't500x500')
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|