podcast-to-youtube 0.1.2 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 77e491cfbcb0953152fe4cf5c987f34427794c38
4
- data.tar.gz: b312d5711ae3390e4628147340c0a35a36860db0
3
+ metadata.gz: 115e31e02b8cb4d5227184c68ae3ff382a87f504
4
+ data.tar.gz: 68258b13e753a549584ecab9f3a543d09ce8ce1e
5
5
  SHA512:
6
- metadata.gz: 41fd7c56663ff97f6c67056c95a07f1d69d9cc5c0aada3abbfed167bc427bf3358be22b7878d07838a7ba4443e62ea0d958474b4331a0b01afc9830c6cb1ace7
7
- data.tar.gz: b78dd5a11fb863d1f97ec972b78c49a2cda6c891099afdd55466eb8373b941a6299e3208066209dced175029e67ee2340cb247b14429007392917e850054c066
6
+ metadata.gz: f90c3477a7415663adb7789ac8dd4b020944d123887be3fc42b7313b3361a8d67ce4f14e6451afa8c09c5a54ade0f0ed9037195fac746d326b070f7d4b3b44d8
7
+ data.tar.gz: b95b9e63d81b0247c34201bb41fc220a88229b33d31479524dfae82b7d5329d35531757d305a2d41457c6b28aaf6c50a3bf1a191429b0f2bf30409418d0f19a1
@@ -1,5 +1,42 @@
1
1
  #!/usr/bin/env ruby
2
+ #
3
+ # calling this locally with ruby -Ilib bin/podcast-to-youtube upload
4
+ # otherwise the installed rubygem gets used
2
5
 
3
6
  require 'podcast-to-youtube'
7
+ require 'optparse'
4
8
 
5
- PodcastUploader.upload
9
+ options = {}
10
+
11
+ opt_parser = OptionParser.new do |opt|
12
+ opt.banner = "Usage: podcast-to-youtube COMMAND [OPTIONS]"
13
+ opt.separator ""
14
+ opt.separator "Commands"
15
+ opt.separator " upload: upload an existing podcast feed to youtube"
16
+ opt.separator ""
17
+ opt.separator "Options"
18
+
19
+ opt.on("-f","--feedurl URL","podcast feed url") do |feedurl|
20
+ options[:feedurl] = feedurl
21
+ end
22
+
23
+ opt.on("-s","--clientsecretfile SECRET","path to the client_secret.json") do |clientsecretfile|
24
+ options[:clientsecretfile] = clientsecretfile
25
+ end
26
+
27
+ opt.on("-c","--videocategoryid ID","youtube video category id for the uploaded vides") do |videocategoryid|
28
+ options[:videocategoryid] = videocategoryid
29
+ end
30
+
31
+ opt.on("-h","--help","print this help") do
32
+ puts opt_parser
33
+ end
34
+ end
35
+
36
+ opt_parser.parse!
37
+
38
+ if ARGV[0] == "upload"
39
+ PodcastUploader.upload(options[:feedurl], options[:clientsecretfile], options[:videocategoryid])
40
+ else
41
+ puts opt_parser
42
+ end
@@ -7,21 +7,16 @@ require 'rubygems'
7
7
  require 'json'
8
8
 
9
9
  class PodcastUploader
10
- def self.upload()
10
+ def self.upload(podcast_feed_url, client_secret_file_path = 'client_secret.json', video_category_id = '28')
11
11
 
12
- client_secret_file_path = 'client_secret.json'
13
12
  if File.file?(client_secret_file_path)
14
13
  client_secret = JSON.parse(File.read(client_secret_file_path))
15
14
  else
16
15
  raise "Please provide client_secret.json. This is required for the Youtube API authentication. More information can be found in the Readme."
17
16
  end
18
17
 
19
- video_category_id = '28'
20
-
21
- puts "enter your podcast feed url and press enter"
22
- url = gets.chomp
23
18
  puts "parsing feed"
24
- feed = Feedjira::Feed.fetch_and_parse url
19
+ feed = Feedjira::Feed.fetch_and_parse podcast_feed_url
25
20
 
26
21
  puts "connecting to youtube account"
27
22
  Yt.configure do |config|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: podcast-to-youtube
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Trauth
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-06 00:00:00.000000000 Z
11
+ date: 2015-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: feedjira