aavimeodl 0.1.1 → 0.2.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 +4 -4
- data/LICENSE.txt +1 -1
- data/README.md +58 -20
- data/aavimeodl.gemspec +1 -1
- data/lib/aavimeodl/AVD.rb +0 -49
- data/lib/aavimeodl/version.rb +1 -1
- data/pkg/aavimeodl-0.1.1.gem +0 -0
- metadata +2 -3
- data/pkg/aavimeodl-0.1.0.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: abc6e606e4df8ecbc84b46ec13aaa66f6347d730
|
4
|
+
data.tar.gz: fee81ef0be3c0f76a3c6caeb2ab2051c6b70cfc5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc025b5c0598d9807da8b4872854bd901bca626ea8ba60cfbcb9d18323a109bab1e88ca090fbbd11f811e168e0c610e8a83899d7487731be15aead956c0d9b2c
|
7
|
+
data.tar.gz: 9d382af980a166970e57ed3a56f23e29873366cf8eda0f2f809dd23627b086d7f10ad791b94135bd0810ccd11f9d993cb163ccf890602f8287f9e6179a22e9bd
|
data/LICENSE.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c) 2017 candyapplecorn
|
3
|
+
Copyright (c) 2017 "Joseph Burger" -- candyapplecorn@gmail.com
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/README.md
CHANGED
@@ -1,39 +1,77 @@
|
|
1
|
-
#
|
1
|
+
# aa-vimeo-downloader
|
2
2
|
|
3
|
-
|
3
|
+
A script for App Academy students which downloads the day's videos
|
4
4
|
|
5
|
-
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
```bash
|
8
|
+
getaavids <week+day> <url to readme raw>
|
9
|
+
```
|
6
10
|
|
7
|
-
|
11
|
+
"_<week+day>_" could be _w4d1_, _w2d2_, etc.
|
8
12
|
|
9
|
-
|
13
|
+
To get the url for the readme raw, simply navigate to the README.md file and select _raw_.
|
14
|
+
Once your screen is filled with plain, unformatted text, grab the url.
|
10
15
|
|
11
|
-
|
12
|
-
|
16
|
+
Here's an example where the user wants to download all the week 2, day 4 videos (with the url truncated):
|
17
|
+
|
18
|
+
```bash
|
19
|
+
getaavids w2d4 https://raw.githubusercontent.com/appacademy/curriculum/.......
|
13
20
|
```
|
14
21
|
|
15
|
-
|
22
|
+
The program will make a folder called _W2D4_videos_ and place all the day's videos in that folder. It might be smart to
|
23
|
+
navigate to the user's _Videos_ directory before running this script!
|
16
24
|
|
17
|
-
|
25
|
+
## Install
|
18
26
|
|
19
|
-
|
27
|
+
### via copy-pasting this shell script into your terminal:
|
28
|
+
```bash
|
29
|
+
cd && \
|
30
|
+
git clone https://github.com/candyapplecorn/aa-vimeo-downloader.git && \
|
31
|
+
mv aa-vimeo-downloader .aa-vimeo-downloader && \
|
32
|
+
cd .aa-vimeo-downloader && \
|
33
|
+
bash install.sh && \
|
34
|
+
exec bash
|
35
|
+
```
|
20
36
|
|
21
|
-
|
37
|
+
### Manual:
|
22
38
|
|
23
|
-
|
39
|
+
After cloning this repository, run the install shell script like so:
|
24
40
|
|
25
|
-
|
41
|
+
```bash
|
42
|
+
bash install.sh
|
43
|
+
```
|
44
|
+
|
45
|
+
This will add an alias to your `.profile`, `.bashrc`, `.asliases` or .`zshrc`, whichever one is found first.
|
46
|
+
The alias will allow the user to run _getaavids.rb_ by entering `getaavids` in the command line.
|
47
|
+
|
48
|
+
#### Troubleshooting:
|
26
49
|
|
27
|
-
|
50
|
+
If the script fails and you're using a Mac, try installing youtube-dl through brew. Once that's done, restart bash and try using the alias again (you can list all your aliases with ```alias -p```).
|
51
|
+
|
52
|
+
```bash
|
53
|
+
brew install youtube-dl
|
54
|
+
exec bash
|
55
|
+
getaavids ...
|
56
|
+
```
|
28
57
|
|
29
|
-
|
58
|
+
## Dependencies
|
30
59
|
|
31
|
-
|
60
|
+
This program requires youtube-dl. I've added an automatic installer to the program, so the user doesn't have to install it manually.
|
61
|
+
If you'd like to install it manually, refer to its website: [https://rg3.github.io/youtube-dl/](https://rg3.github.io/youtube-dl/)
|
32
62
|
|
33
|
-
##
|
63
|
+
## Video Playback
|
34
64
|
|
35
|
-
|
65
|
+
If you don't have a video player which allows the playback speed to be adjusted, consider giving VLC a try. [https://www.videolan.org/vlc/index.html](https://www.videolan.org/vlc/index.html)
|
36
66
|
|
37
|
-
##
|
67
|
+
## How I Turned this Into a Gem:
|
68
|
+
|
69
|
+
[http://guides.rubygems.org/make-your-own-gem/](http://guides.rubygems.org/make-your-own-gem/)
|
38
70
|
|
39
|
-
|
71
|
+
[http://robdodson.me/how-to-write-a-command-line-ruby-gem/](http://robdodson.me/how-to-write-a-command-line-ruby-gem/)
|
72
|
+
|
73
|
+
[http://guides.rubygems.org/specification-reference/#add_runtime_dependency](http://guides.rubygems.org/specification-reference/#add_runtime_dependency)
|
74
|
+
|
75
|
+
Example of an executable gem: [https://github.com/qrush/hola](https://github.com/qrush/hola), and the directions: [http://guides.rubygems.org/make-your-own-gem/#requiring-more-files](http://guides.rubygems.org/make-your-own-gem/#requiring-more-files)
|
76
|
+
|
77
|
+
The 1st parts here are helpful: [https://bundler.io/v1.13/guides/creating_gem](https://bundler.io/v1.13/guides/creating_gem)
|
data/aavimeodl.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["candyapplecorn@gmail.com"]
|
11
11
|
|
12
12
|
spec.summary = %q{Downloads private App Academy videos from Vimeo}
|
13
|
-
spec.homepage = "
|
13
|
+
spec.homepage = "https://github.com/candyapplecorn/aa-vimeo-downloader"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
data/lib/aavimeodl/AVD.rb
CHANGED
@@ -1,7 +1,4 @@
|
|
1
1
|
require 'open-uri'
|
2
|
-
require 'io/console'
|
3
|
-
require 'pty'
|
4
|
-
# No installation! Wew!
|
5
2
|
require 'youtube-dl'
|
6
3
|
|
7
4
|
class GitRaw
|
@@ -42,35 +39,6 @@ class LinkParser
|
|
42
39
|
end
|
43
40
|
end
|
44
41
|
|
45
|
-
# should be able to remove this once binding works correctly
|
46
|
-
def has_youtube_dl?
|
47
|
-
if `which youtube-dl` =~ /^$/
|
48
|
-
print <<~HEREDOC
|
49
|
-
The dependency 'youtube_dl' is not installed.
|
50
|
-
To install this program, see
|
51
|
-
https://rg3.github.io/youtube-dl/download.html
|
52
|
-
|
53
|
-
Are you using OSX or Linux and would like to
|
54
|
-
install youtube_dl automatically?
|
55
|
-
HEREDOC
|
56
|
-
|
57
|
-
print "[Y/N]: "
|
58
|
-
|
59
|
-
if STDIN.gets =~ /y/i
|
60
|
-
raise "Install failed; please install manually" unless install_youtube_dl
|
61
|
-
return true
|
62
|
-
else
|
63
|
-
abort('Install youtube_dl to use this program')
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
def install_youtube_dl
|
69
|
-
`sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl`
|
70
|
-
`sudo chmod a+rx /usr/local/bin/youtube-dl`
|
71
|
-
`which youtube-dl` =~ /^$/
|
72
|
-
end
|
73
|
-
|
74
42
|
class Credentials
|
75
43
|
attr_reader :day, :url, :vimeo_password
|
76
44
|
def initialize
|
@@ -115,23 +83,11 @@ end
|
|
115
83
|
# Replace this with ruby binding
|
116
84
|
def get_video(name, link, pass)
|
117
85
|
title = "#{name}.%(ext)s"
|
118
|
-
command = %{youtube-dl --video-password "#{pass}" -o "#{title}" #{link}}
|
119
86
|
|
120
87
|
YoutubeDL.download link, {
|
121
88
|
"video-password": pass,
|
122
89
|
"o": title
|
123
90
|
}
|
124
|
-
|
125
|
-
# begin
|
126
|
-
# PTY.spawn(command) do |stdout, _stdin, _pid|
|
127
|
-
# begin
|
128
|
-
# stdout.each { |line| print line }
|
129
|
-
# rescue Errno::EIO
|
130
|
-
# end
|
131
|
-
# end
|
132
|
-
# rescue PTY::ChildExited
|
133
|
-
# puts "The child process exited!"
|
134
|
-
# end
|
135
91
|
end
|
136
92
|
|
137
93
|
class Aavimeodl::AVD
|
@@ -144,11 +100,6 @@ class Aavimeodl::AVD
|
|
144
100
|
end
|
145
101
|
|
146
102
|
if $PROGRAM_NAME == __FILE__
|
147
|
-
#has_youtube_dl? # This will go since ruby binding should work
|
148
|
-
# creds = Credentials.new
|
149
|
-
# raw = GitRaw.new creds.url
|
150
|
-
# links = LinkParser.new(raw, creds)
|
151
|
-
# make_video_dir(creds, links.links)
|
152
103
|
Aavimeodl::AVD.new
|
153
104
|
end
|
154
105
|
|
data/lib/aavimeodl/version.rb
CHANGED
data/pkg/aavimeodl-0.1.1.gem
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aavimeodl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- candyapplecorn
|
@@ -86,9 +86,8 @@ files:
|
|
86
86
|
- lib/aavimeodl.rb
|
87
87
|
- lib/aavimeodl/AVD.rb
|
88
88
|
- lib/aavimeodl/version.rb
|
89
|
-
- pkg/aavimeodl-0.1.0.gem
|
90
89
|
- pkg/aavimeodl-0.1.1.gem
|
91
|
-
homepage:
|
90
|
+
homepage: https://github.com/candyapplecorn/aa-vimeo-downloader
|
92
91
|
licenses:
|
93
92
|
- MIT
|
94
93
|
metadata:
|
data/pkg/aavimeodl-0.1.0.gem
DELETED
Binary file
|