sportsflix 1.2.7 → 1.2.8
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/sportsflix/providers/arenavision.rb +26 -18
- data/lib/sportsflix/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ae74f83e94368964eefc12a4f973a7e1aed4a0e
|
4
|
+
data.tar.gz: 1623ac63bfb583d3eb2aaa8545907851923e83c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5067531f02ed1a13c87af36b834291fc3528ed668dcda198099b662c776404539b494cc60a16a4f32c2322facc1e18b72488db2cac7ee34943d2647790f6118e
|
7
|
+
data.tar.gz: dd693a82da31321bd2e0261362e632520ba798b5552be04f84f729eabdf5d50473b075d2aa8a14b4da1a2e3cc123655fe234c95828edb03bad876977d5b83a82
|
data/Gemfile.lock
CHANGED
@@ -5,7 +5,7 @@ module Sportsflix
|
|
5
5
|
module Providers
|
6
6
|
module Arenavision
|
7
7
|
class Client
|
8
|
-
BASE_URLS = ['http://arenavision.in', 'http://arenavision.ru']
|
8
|
+
BASE_URLS = ['http://arenavision.in', 'http://arenavision.ru', 'http://arenavision.us']
|
9
9
|
BASE_URL = BASE_URLS.sample
|
10
10
|
|
11
11
|
def initialize(options)
|
@@ -17,8 +17,13 @@ module Sportsflix
|
|
17
17
|
|
18
18
|
def list_streams
|
19
19
|
home = get_page_contents("#{BASE_URL}/")
|
20
|
-
schedule_path = home.css('a').select {|item| item.text.include?('EVENTS GUIDE')}.first.get('href')
|
21
|
-
|
20
|
+
schedule_path = home.css('a').select { |item| item.text.include?('EVENTS GUIDE') }.first.get('href')
|
21
|
+
schedule_url = if schedule_path.start_with?("http")
|
22
|
+
schedule_path
|
23
|
+
else
|
24
|
+
"#{BASE_URL}#{schedule_path}"
|
25
|
+
end
|
26
|
+
schedule = get_page_contents(schedule_url)
|
22
27
|
streams = schedule.css('table tr')
|
23
28
|
# Remove first element
|
24
29
|
streams = streams.drop(1)
|
@@ -35,25 +40,28 @@ module Sportsflix
|
|
35
40
|
|
36
41
|
streams.map do |item|
|
37
42
|
{
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
43
|
+
:date => clean_str(item.css('td:nth-child(1)').text),
|
44
|
+
:hour => clean_str(item.css('td:nth-child(2)').text),
|
45
|
+
:sport => clean_str(item.css('td:nth-child(3)').text),
|
46
|
+
:competition => clean_str(item.css('td:nth-child(4)').text),
|
47
|
+
:game => clean_str(item.css('td:nth-child(5)').text),
|
48
|
+
:stream_nr => parse_stream_ids(clean_str(item.css('td:nth-child(6)').text)),
|
49
|
+
:proxy => :acestream
|
45
50
|
}
|
46
51
|
end
|
47
52
|
end
|
48
53
|
|
49
54
|
def get_stream_uri(stream_nr)
|
50
|
-
|
51
|
-
|
55
|
+
home = get_page_contents("#{BASE_URL}/")
|
56
|
+
stream_link = home.css('a').select { |item| item.text.include?("ArenaVision #{stream_nr}") }.first.get('href')
|
57
|
+
stream_raw = get_page_contents(stream_link)
|
58
|
+
stream_raw.css('a').select { |item| !item.get('href').nil? && item.get('href').include?('acestream://') }.first.get('href')
|
52
59
|
end
|
53
60
|
|
54
61
|
private
|
62
|
+
|
55
63
|
def get_page_contents(raw_url)
|
56
|
-
html_str = @http.get(raw_url, {}, {Cookie: 'beget=begetok;'}).body
|
64
|
+
html_str = @http.get(raw_url, {}, { Cookie: 'beget=begetok;' }).body
|
57
65
|
Oga.parse_xml(html_str)
|
58
66
|
end
|
59
67
|
|
@@ -61,17 +69,17 @@ module Sportsflix
|
|
61
69
|
matches = raw_stream.scan(/(([0-9]+)(?:-([0-9]+))? \[(.+?)\])/)
|
62
70
|
matches.map do |match|
|
63
71
|
{
|
64
|
-
|
65
|
-
|
66
|
-
|
72
|
+
:start => match[1].to_i,
|
73
|
+
:end => (match[2] || match[1]).to_i,
|
74
|
+
:language => match[3]
|
67
75
|
}
|
68
76
|
end
|
69
77
|
end
|
70
78
|
|
71
79
|
def clean_str(str)
|
72
80
|
str.force_encoding('UTF-8')
|
73
|
-
|
74
|
-
|
81
|
+
.gsub("\n\t\t", ' ')
|
82
|
+
.strip
|
75
83
|
end
|
76
84
|
|
77
85
|
end
|
data/lib/sportsflix/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sportsflix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rodrigo Fernandes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|