video_grabber 1.8.0 → 1.8.6

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: be3fad3a188a7f87df6e1da1aa2c2ab9047a4c3f
4
- data.tar.gz: a166877391ef4641acd1c893dd47b12c8ff0f6ab
3
+ metadata.gz: 24d983af701f39b60d5a1af07a22455e5dba9919
4
+ data.tar.gz: c31b4296a648229974698d5899dbf80cf9910608
5
5
  SHA512:
6
- metadata.gz: edef2ec15170fd779860673c5ae004fe71c7bb786abc609db5633dbe1cebb64abca0266838582a75b55467e97d7f9b58fdbdaba8daeb89268552f78b64422ec9
7
- data.tar.gz: 6e488a487db380a33869a39c2acf911842a1d4e909059672f86cf1c0dcbe00981b48282242c60c4d061d3d51bf5333adc8a4c750514b0275e69e4d9a555abf44
6
+ metadata.gz: df2455a44aa60f953a672abd15c096cf36a72cbf03652438e0d4ed2e87463bd733e774955af1462d97a4aefe736c5571a760314bb1e2ec016bedfa64a97eb976
7
+ data.tar.gz: bbbb54421a8f655f89776712f8d259f1c5ce11c7af7f41dd304dced8481505809529d30c13f514cca4b76319ccf2effac11245984c916840989467966bdb3675
data/Gemfile.lock CHANGED
@@ -1,12 +1,12 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- video_grabber (1.8.0)
4
+ video_grabber (1.8.6)
5
5
  headless
6
6
  nokogiri
7
7
  phantomjs
8
8
  pry
9
- selenium-webdriver
9
+ selenium-webdriver (~> 2.53.4)
10
10
  watir
11
11
 
12
12
  GEM
@@ -1,8 +1,8 @@
1
1
  module VideoGrabber
2
2
  class Scraper
3
3
 
4
- attr_reader :url, :browser, :timeout, :keep_browser_open, :headless_enabled,
5
- :firefox_extension_path, :profile, :html_attributes, :browser_type
4
+ attr_reader :url, :browser, :timeout, :keep_browser_open, :headless_enabled, :browser_parameters,
5
+ :firefox_extension_path, :html_attributes, :browser_type
6
6
 
7
7
  def initialize(config)
8
8
  @keep_browser_open = config.keep_browser_open
@@ -12,6 +12,7 @@ module VideoGrabber
12
12
  @firefox_extension_path = config.firefox_extension_path
13
13
  @html_attributes = config.html_attributes
14
14
  @browser_type = config.browser
15
+ @browser_parameters = { http_client: browser_http_client }
15
16
  end
16
17
 
17
18
  def start
@@ -51,13 +52,18 @@ module VideoGrabber
51
52
 
52
53
  private
53
54
 
55
+ def browser_http_client
56
+ client = Selenium::WebDriver::Remote::Http::Default.new
57
+ client.timeout = timeout
58
+
59
+ client
60
+ end
61
+
54
62
  def open_browser
55
63
  start_headless
64
+ load_extension
56
65
 
57
- @profile = ::Selenium::WebDriver::Firefox::Profile.new && load_extension if firefox_extension_path
58
- client = Selenium::WebDriver::Remote::Http::Default.new
59
- client.timeout = timeout
60
- @browser = ::Watir::Browser.new(browser_type, profile: profile, http_client: client)
66
+ @browser = ::Watir::Browser.new(browser_type, browser_parameters)
61
67
  end
62
68
 
63
69
  def start_headless
@@ -69,7 +75,10 @@ module VideoGrabber
69
75
  def load_extension
70
76
  return unless firefox_extension_path
71
77
 
72
- @profile.add_extension(firefox_extension_path)
78
+ profile = ::Selenium::WebDriver::Firefox::Profile.new
79
+ profile.add_extension(firefox_extension_path)
80
+
81
+ @browser_parameters[:profile] = @profile
73
82
  rescue Selenium::WebDriver::Error::WebDriverError => e
74
83
  raise ::VideoGrabber::ExtensionError, e
75
84
  end
@@ -1,3 +1,3 @@
1
1
  module VideoGrabber
2
- VERSION = "1.8.0"
2
+ VERSION = "1.8.6"
3
3
  end
Binary file
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.executables = ['video_grabber']
27
27
  spec.require_paths = ['lib']
28
28
 
29
- spec.add_dependency 'selenium-webdriver'
29
+ spec.add_dependency 'selenium-webdriver', '~> 2.53.4'
30
30
  spec.add_dependency 'watir'
31
31
  spec.add_dependency 'headless'
32
32
  spec.add_dependency 'nokogiri'
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.8.0
4
+ version: 1.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - sidney
@@ -14,16 +14,16 @@ dependencies:
14
14
  name: selenium-webdriver
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 2.53.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: 2.53.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: watir
29
29
  requirement: !ruby/object:Gem::Requirement