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 +4 -4
- data/Gemfile.lock +2 -2
- data/lib/video_grabber/scraper.rb +16 -7
- data/lib/video_grabber/version.rb +1 -1
- data/pkg/video_grabber-1.8.0.gem +0 -0
- data/video_grabber.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24d983af701f39b60d5a1af07a22455e5dba9919
|
4
|
+
data.tar.gz: c31b4296a648229974698d5899dbf80cf9910608
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df2455a44aa60f953a672abd15c096cf36a72cbf03652438e0d4ed2e87463bd733e774955af1462d97a4aefe736c5571a760314bb1e2ec016bedfa64a97eb976
|
7
|
+
data.tar.gz: bbbb54421a8f655f89776712f8d259f1c5ce11c7af7f41dd304dced8481505809529d30c13f514cca4b76319ccf2effac11245984c916840989467966bdb3675
|
data/Gemfile.lock
CHANGED
@@ -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, :
|
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
|
-
@
|
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
|
-
|
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
|
data/pkg/video_grabber-1.8.0.gem
CHANGED
Binary file
|
data/video_grabber.gemspec
CHANGED
@@ -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.
|
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:
|
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:
|
26
|
+
version: 2.53.4
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: watir
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|