sportsflix 1.5.0 → 1.6.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/Gemfile.lock +2 -2
- data/lib/sportsflix/providers/arenavision.rb +8 -1
- data/lib/sportsflix/utils/http.rb +3 -2
- data/lib/sportsflix/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ea041dbb071da1bcd51eccb712000c9287f2f60
|
4
|
+
data.tar.gz: 43bd6b1284ac3f7ca6e3b2586747095ad45ebe44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfc386a5141f5aded8bfa4f655b5dfc10cfd0406332159d704ba337990d1f2fa645f590f836063542ec65f4a9de3e9c3f435e2a191d5d987ed59c16764f239d7
|
7
|
+
data.tar.gz: df74131c7528718f430c1fe8d6c0a45b10e46b1cfa65665cfce7f78431a4f8005bcd2187a8ab9ca52f031231a365ebabe56f1f479e285109e1c197c3bd13b4b7
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
sportsflix (1.
|
4
|
+
sportsflix (1.6.0)
|
5
5
|
execjs-fastnode (~> 0.2)
|
6
6
|
oga (~> 2.15)
|
7
7
|
therubyracer (~> 0.12)
|
@@ -21,7 +21,7 @@ GEM
|
|
21
21
|
execjs (~> 2.0)
|
22
22
|
jaro_winkler (1.5.2)
|
23
23
|
json (2.2.0)
|
24
|
-
libv8 (3.16.14.19)
|
24
|
+
libv8 (3.16.14.19-x86_64-linux)
|
25
25
|
oga (2.15)
|
26
26
|
ast
|
27
27
|
ruby-ll (~> 2.1)
|
@@ -64,7 +64,14 @@ module Sportsflix
|
|
64
64
|
private
|
65
65
|
|
66
66
|
def get_page_contents(raw_url)
|
67
|
-
html_str = @http.get(raw_url, {}, {
|
67
|
+
html_str = @http.get(raw_url, {}, {
|
68
|
+
'Cookie': 'beget=begetok;',
|
69
|
+
'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0',
|
70
|
+
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
|
71
|
+
'Accept-Language': 'en-GB,pt;q=0.5',
|
72
|
+
'DNT': '1',
|
73
|
+
'Connection': 'keep-alive'
|
74
|
+
}).body
|
68
75
|
Oga.parse_xml(html_str)
|
69
76
|
end
|
70
77
|
|
@@ -82,11 +82,12 @@ module Sportsflix
|
|
82
82
|
|
83
83
|
def needs_cf_answer(res)
|
84
84
|
res.is_a?(Net::HTTPServiceUnavailable) &&
|
85
|
-
res['Server']
|
85
|
+
res['Server'].include?('cloudflare') &&
|
86
86
|
res.body.include?('jschl_vc') &&
|
87
87
|
res.body.include?('jschl_answer')
|
88
88
|
end
|
89
89
|
|
90
|
+
# Source: https://github.com/Anorov/cloudflare-scrape/blob/master/cfscrape/__init__.py#L115
|
90
91
|
def solve_challenge(body)
|
91
92
|
begin
|
92
93
|
js = /setTimeout\(function\(\){\s+(var s,t,o,p,b,r,e,a,k,i,n,g,f.+?\r?\n[\s\S]+?a\.value =.+?)\r?\n/.match(body)
|
@@ -95,7 +96,7 @@ module Sportsflix
|
|
95
96
|
exit(1)
|
96
97
|
end
|
97
98
|
|
98
|
-
js = js.gsub("a\.value = (
|
99
|
+
js = js.gsub("a\.value = (.+ \+ t\.length).+", "\1")
|
99
100
|
js = js.gsub("\s{3,}[a-z](?: = |\.).+", '')
|
100
101
|
|
101
102
|
# Strip characters that could be used to exit the string context
|
data/lib/sportsflix/version.rb
CHANGED