youtube_sync 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +72 -0
- data/Rakefile +2 -0
- data/bin/youtube_sync +4 -0
- data/lib/youtube_sync/version.rb +3 -0
- data/lib/youtube_sync.rb +54 -0
- data/youtube_sync.gemspec +26 -0
- metadata +110 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 20c89e9b1062b30acf5557181407b09f920d9bc5
|
4
|
+
data.tar.gz: 846b515e7aa2aedbb0f1ee9acd981309f483f12b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e28470e85ec463eda8e2c45e7169cfe199ccf6fc6797359126ac7bb5c0a4d0f2a1a8ae196928936b57e2ef7fb389f55c6edcf29ee9a6f87a1d2b87101f6d1499
|
7
|
+
data.tar.gz: 4a1ec739d35029d6020e939cfa63878003dc28c2b6b274a48840b7dbd44743546485d9e6e5abf6930c2a35632852a0e0cc33e4202f03822d8b56bcafaee1208f
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2015 Ioannis Kolovos
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
# YoutubeSync
|
2
|
+
|
3
|
+
Download your youtube videos from a text file list
|
4
|
+
|
5
|
+
## Usage
|
6
|
+
default `directory` is `~/Desktop/Youtube`
|
7
|
+
default `file` `~/Desktop/Youtube/links.txt`
|
8
|
+
|
9
|
+
So if you have a directory and the file you can just use it with out arguments
|
10
|
+
|
11
|
+
$ youtube_sync
|
12
|
+
|
13
|
+
To use a different file and folder
|
14
|
+
|
15
|
+
$ youtube_sync -d /Users/Ioannis/Downloads -f list.txt
|
16
|
+
|
17
|
+
where `-d` is the directory you want to save videos and `-f` the file to load
|
18
|
+
|
19
|
+
> `NOTE` File must be in the same directory
|
20
|
+
|
21
|
+
## The list file
|
22
|
+
Each url should be in a new line
|
23
|
+
You can comment the line with `#` if you want to skip it
|
24
|
+
|
25
|
+
|
26
|
+
## Help
|
27
|
+
|
28
|
+
$ youtube_sync help
|
29
|
+
or
|
30
|
+
|
31
|
+
$ youtube_sync help perform
|
32
|
+
|
33
|
+
You will get:
|
34
|
+
|
35
|
+
Options:
|
36
|
+
-d, [--dir=DIR] # Directory to store videos
|
37
|
+
# Default: ~/Desktop/Youtube
|
38
|
+
-f, [--file=FILE] # File to load urls
|
39
|
+
# Default: ~/Desktop/Youtube/links.txt
|
40
|
+
|
41
|
+
Description:
|
42
|
+
Passing a `-d` for a directory and `-f` for the file
|
43
|
+
|
44
|
+
example:
|
45
|
+
|
46
|
+
> $ youtube_sync -d /Users/Ioannis/Downloads -f list.txt
|
47
|
+
## Help
|
48
|
+
|
49
|
+
## Installation
|
50
|
+
|
51
|
+
Add this line to your application's Gemfile:
|
52
|
+
|
53
|
+
```ruby
|
54
|
+
gem 'youtube_sync'
|
55
|
+
```
|
56
|
+
|
57
|
+
And then execute:
|
58
|
+
|
59
|
+
$ bundle
|
60
|
+
|
61
|
+
Or install it yourself as:
|
62
|
+
|
63
|
+
$ gem install youtube_sync
|
64
|
+
|
65
|
+
|
66
|
+
## Contributing
|
67
|
+
|
68
|
+
1. Fork it ( https://github.com/msroot/youtube_sync/fork )
|
69
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
70
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
71
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
72
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/bin/youtube_sync
ADDED
data/lib/youtube_sync.rb
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
require "youtube_sync/version"
|
2
|
+
require 'viddl-rb'
|
3
|
+
require "thor"
|
4
|
+
require 'yaml'
|
5
|
+
|
6
|
+
module YoutubeSync
|
7
|
+
class CLI < Thor
|
8
|
+
|
9
|
+
default_task :perform
|
10
|
+
desc "perform", "Download all links"
|
11
|
+
|
12
|
+
long_desc <<-LONGDESC
|
13
|
+
Passing a `-d` for a directory and `-f` for the file \n
|
14
|
+
|
15
|
+
example:\n
|
16
|
+
> $ youtube_sync -d /Users/Ioannis/Downloads -f list.txt\n
|
17
|
+
|
18
|
+
NOTE: file must be in the same directory
|
19
|
+
LONGDESC
|
20
|
+
|
21
|
+
method_option :dir,
|
22
|
+
:aliases => "-d",
|
23
|
+
:desc => "Directory to store videos",
|
24
|
+
:default => File.join(ENV['HOME'], "Desktop", "Youtube")
|
25
|
+
|
26
|
+
method_option :file,
|
27
|
+
:aliases => "-f",
|
28
|
+
:desc => "File to load urls",
|
29
|
+
:default => File.join(ENV['HOME'], "Desktop", "Youtube", "links.txt")
|
30
|
+
|
31
|
+
def perform
|
32
|
+
dir, file = options[:dir], options[:file]
|
33
|
+
|
34
|
+
[dir, file].each do |required|
|
35
|
+
say "#{required} not exist", :red and return unless File.exist?(required)
|
36
|
+
end
|
37
|
+
|
38
|
+
open(file, 'r').each_line do |video|
|
39
|
+
video.strip!
|
40
|
+
|
41
|
+
if video.start_with? '#'
|
42
|
+
say "Skipping #{video}", :yellow
|
43
|
+
next
|
44
|
+
end
|
45
|
+
|
46
|
+
say "Downloading: #{video}", :green
|
47
|
+
|
48
|
+
`cd #{dir} && viddl-rb -a #{video}`
|
49
|
+
end
|
50
|
+
say "Done!", :green
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'youtube_sync/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "youtube_sync"
|
8
|
+
spec.version = YoutubeSync::VERSION
|
9
|
+
spec.authors = ["Ioannis Kolovos"]
|
10
|
+
spec.email = ["yannis.kolovos@gmail.com"]
|
11
|
+
spec.summary = "Youtube Sync"
|
12
|
+
spec.description = "Download your youtube videos from a text file list"
|
13
|
+
spec.homepage = "https://github.com/msroot/youtube_sync"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
spec.executables = ['youtube_sync']
|
21
|
+
|
22
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
23
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
24
|
+
spec.add_dependency "viddl-rb", "~> 1.1.1"
|
25
|
+
spec.add_runtime_dependency "thor", "~> 0.19.1"
|
26
|
+
end
|
metadata
ADDED
@@ -0,0 +1,110 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: youtube_sync
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ioannis Kolovos
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-04-25 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.7'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.7'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: viddl-rb
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 1.1.1
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.1.1
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: thor
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.19.1
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.19.1
|
69
|
+
description: Download your youtube videos from a text file list
|
70
|
+
email:
|
71
|
+
- yannis.kolovos@gmail.com
|
72
|
+
executables:
|
73
|
+
- youtube_sync
|
74
|
+
extensions: []
|
75
|
+
extra_rdoc_files: []
|
76
|
+
files:
|
77
|
+
- ".gitignore"
|
78
|
+
- Gemfile
|
79
|
+
- LICENSE.txt
|
80
|
+
- README.md
|
81
|
+
- Rakefile
|
82
|
+
- bin/youtube_sync
|
83
|
+
- lib/youtube_sync.rb
|
84
|
+
- lib/youtube_sync/version.rb
|
85
|
+
- youtube_sync.gemspec
|
86
|
+
homepage: https://github.com/msroot/youtube_sync
|
87
|
+
licenses:
|
88
|
+
- MIT
|
89
|
+
metadata: {}
|
90
|
+
post_install_message:
|
91
|
+
rdoc_options: []
|
92
|
+
require_paths:
|
93
|
+
- lib
|
94
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
99
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
requirements: []
|
105
|
+
rubyforge_project:
|
106
|
+
rubygems_version: 2.2.2
|
107
|
+
signing_key:
|
108
|
+
specification_version: 4
|
109
|
+
summary: Youtube Sync
|
110
|
+
test_files: []
|