aerial_ruby_client 1.0.2 → 1.1.0
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/lib/xscreensaver_script.rb +15 -0
- metadata +4 -4
- data/lib/aerial_ruby_client.rb +0 -38
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49ccf68e8b8dea0f2ef6f86800af50df214b33b8
|
4
|
+
data.tar.gz: b2c11a9b74d4672c317a955f0f9cb4012622c19a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8682b2f682c813c1f61a4c7311e792c718324f5a20e867f54e53c57f1570046d15765a0146acc791139462161bb885ac9232ee4980ac4c35d0ea33dc3c0741d4
|
7
|
+
data.tar.gz: e836ec06585c9ca63c0ec01e651272846b4fb8bb858c06ce934e383306c86c963835d6c103438600882166dd24b15473839ed3fc2f70e0b51d95ecde38521c49
|
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# Will be used by exec to launch mpv.
|
4
|
+
mpv = "mpv --really-quiet --shuffle --no-audio --fs --loop=inf --no-stop-screensaver --wid=$XSCREENSAVER_WINDOW --panscan=1"
|
5
|
+
|
6
|
+
day = File.join(Dir.home, '*', 'day-*.mov')
|
7
|
+
#=> /home/username/*/day-*.mov
|
8
|
+
night = File.join(Dir.home, '*', 'night-*.mov')
|
9
|
+
#=> /home/username/*/night-*.mov
|
10
|
+
|
11
|
+
if Time.new.hour.between?(7,19)
|
12
|
+
exec("#{mpv} #{day}") # Replaces the current process by running the external command.
|
13
|
+
else
|
14
|
+
exec("#{mpv} #{night}")
|
15
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aerial_ruby_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- m-gb
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -74,7 +74,7 @@ executables: []
|
|
74
74
|
extensions: []
|
75
75
|
extra_rdoc_files: []
|
76
76
|
files:
|
77
|
-
- lib/
|
77
|
+
- lib/xscreensaver_script.rb
|
78
78
|
homepage: http://rubygems.org/gems/aerial_ruby_client
|
79
79
|
licenses:
|
80
80
|
- MIT
|
@@ -95,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
95
|
version: '0'
|
96
96
|
requirements: []
|
97
97
|
rubyforge_project:
|
98
|
-
rubygems_version: 2.6.
|
98
|
+
rubygems_version: 2.6.14
|
99
99
|
signing_key:
|
100
100
|
specification_version: 4
|
101
101
|
summary: Aerial Apple TV video downloader
|
data/lib/aerial_ruby_client.rb
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'httparty'
|
4
|
-
require 'json'
|
5
|
-
require 'open-uri'
|
6
|
-
|
7
|
-
def download_aerials(foldername)
|
8
|
-
aerialdir = File.join(Dir.home, foldername)
|
9
|
-
#=> /root/Aerial or C:/Users/root/Aerial depending on the platform.
|
10
|
-
|
11
|
-
Dir.mkdir(aerialdir) unless Dir.exists?(aerialdir)
|
12
|
-
|
13
|
-
url = 'http://a1.phobos.apple.com/us/r1000/000/Features/atv/' +
|
14
|
-
'AutumnResources/videos/entries.json'
|
15
|
-
|
16
|
-
response = HTTParty.get(url)
|
17
|
-
parsed = JSON.parse(response)
|
18
|
-
urls = []
|
19
|
-
parsed.each do |item|
|
20
|
-
item['assets'].each do |asset|
|
21
|
-
urls << asset['url']
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
urls.each do |url|
|
26
|
-
filename = url.split('/').last
|
27
|
-
filepath = File.join(aerialdir, filename)
|
28
|
-
if File.exists?(filepath)
|
29
|
-
puts "File #{filename} already exists, skipping..."
|
30
|
-
else
|
31
|
-
open(url) do |u|
|
32
|
-
puts "Downloading #{url} to #{filepath}"
|
33
|
-
File.open(filepath, 'wb') { |f| f.write(u.read) }
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
puts 'Finished processing all URLs!'
|
38
|
-
end
|