video_grabber 1.5.0 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3a484f6d9d5b763ae659792576bb8cc1d4e3a9ca
4
- data.tar.gz: 8e7c4c25c9cfb9f06baf50f14f1e4e1c7ea0b37f
3
+ metadata.gz: 42b16033bdf111d37375a5253c02a89d04d5a93e
4
+ data.tar.gz: fb3cf3dbd626dd8c51e9391981b56598445d5f34
5
5
  SHA512:
6
- metadata.gz: 0c92fa9ac5e5c9de371d2753cd70ae284f4daec88f038ac5df3f6d1a74262b73248c8166e710e7cc0c1c49cdab2a86ddde8b1a44204b96c004ff421b2f49f142
7
- data.tar.gz: dad4f99ccd6fd9a64672645c84e6ed013daa00f300186d668f39ee9d3f4175005cc1df238ff77e88abd6ab47dce1a52e33b9c93fa20969aaf6357b1b25902a86
6
+ metadata.gz: 020ea57cb51f5b61abd8b64fb0a7ca7e6e290f0a50c33a801d3641be0b4953e03b7eede781ea87498f01afba6d3857600a49d5cdf52cf83521303f4a3401291e
7
+ data.tar.gz: 4e2677496204205b512e59d9209a50d39ca5e0ec92f49df5ceaae2959b2654e167632b5a5eb4db3881b4ab75b926b202f5d154ca885b39ac66fba0079c9bfe03
data/README.md CHANGED
@@ -69,7 +69,7 @@ Or you can directly pass the param `keep_browser_open` during initialization.
69
69
  - **timeout:** *(default: 60)* The timeout for the scraper. Will trigger a `VideoGrabber::Timeout` if the delay is met.
70
70
  - **keep_browser_open** *(default: false)* If activated, will keep the scraper's browser open as long as you do not stop it (using the `stop` public method.).
71
71
  - **headless_enabled** *(default: true)* If disabled, will open your Firefox browser to crawl your links.
72
- - **attributes** This option enables you to pass html attributes that will be passed to your crawled links elements.
72
+ - **html_attributes** *(default: {controls: true})* This option enables you to pass html attributes that will be passed to your crawled links elements.
73
73
  - **firefox_extension_path** If passed, your Scraper instance will run using the given extension (`.xpi` file). Useful if you want to benefit from an Adblocker for instance
74
74
 
75
75
  ## Versioning
@@ -23,12 +23,13 @@ module VideoGrabber
23
23
  class Configuration
24
24
 
25
25
  attr_accessor :url, :keep_browser_open, :timeout, :headless_enabled,
26
- :firefox_extension_path, :attributes
26
+ :firefox_extension_path, :html_attributes
27
27
 
28
28
  def initialize
29
29
  @keep_browser_open = false
30
30
  @timeout = 60
31
31
  @headless_enabled = true
32
+ @html_attributes = { controls: true }
32
33
  end
33
34
  end
34
35
  end
@@ -2,7 +2,7 @@ module VideoGrabber
2
2
  class Scraper
3
3
 
4
4
  attr_reader :url, :browser, :timeout, :keep_browser_open, :headless_enabled,
5
- :firefox_extension_path, :profile, :attributes
5
+ :firefox_extension_path, :profile, :html_attributes
6
6
 
7
7
  def initialize(config)
8
8
  @keep_browser_open = config.keep_browser_open
@@ -10,7 +10,7 @@ module VideoGrabber
10
10
  @timeout = config.timeout
11
11
  @headless_enabled = config.headless_enabled
12
12
  @firefox_extension_path = config.firefox_extension_path
13
- @attributes = config.attributes
13
+ @html_attributes = config.html_attributes
14
14
  end
15
15
 
16
16
  def start
@@ -74,13 +74,13 @@ module VideoGrabber
74
74
  end
75
75
 
76
76
  def add_attributes(list)
77
- return unless attributes
77
+ return unless html_attributes
78
78
 
79
79
  list.map do |element|
80
80
 
81
81
  parsed_element = Nokogiri::XML(element)
82
82
 
83
- attributes.each do |key, value|
83
+ html_attributes.each do |key, value|
84
84
  parsed_element.xpath('//video').first.set_attribute(key, value)
85
85
  end
86
86
 
@@ -1,3 +1,3 @@
1
1
  module VideoGrabber
2
- VERSION = "1.5.0"
2
+ VERSION = "1.6.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: video_grabber
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - sidney