video_chat_get 0.2.0 → 0.2.3

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
  SHA256:
3
- metadata.gz: 940835e5e23b987d59e3f3764755ecc9ff0dc3b8b65e0f7868b60b8a3fa5c399
4
- data.tar.gz: 60ca38a9815e0771ee3aee3a679af8bd4ef77b719b6e2f4535659b8e922ea5c1
3
+ metadata.gz: f742a50cefadcf590f21ab2246937d79f9329f0148cde5465e44d4709c2b764c
4
+ data.tar.gz: 5a60651594271a7bf352113d84669067e1b3430f32b2aac1ee263a5945c2b07f
5
5
  SHA512:
6
- metadata.gz: 4ac8d649dbc9a61c837d85ea4100c6e82e20062b82bec00d36e98375c8a48b7cc9609ebbc829d577018e3722365be8ac96c058599b4d2afbd7422de5315527d2
7
- data.tar.gz: 0edbbd898b99808feb4594b7f8e10f5fccc898befe6ecca95c120ad55e8535f302abe2d3162aefb57c5359862e4fc144305a8a6e7489811b8195757ffa7161e7
6
+ metadata.gz: d734cae4cf271edfb9b92f5f66f05815a4543f7615f751f217e670b07aa748f76bfc6ca6a67b04dc571879f5fba445f65ba6a617fa13d8e923b5989388debb69
7
+ data.tar.gz: b1d81f6d0bfe9c2d24e158498833ee803f91750e48168adeef93f022c3c6ad7044f33522808954d5866f771cf78872b1aed0a82dd3a9e93daa614030e94ee28e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- video_chat_get (0.2.0)
4
+ video_chat_get (0.2.3)
5
5
  httpclient (~> 2.8.3)
6
6
  json (~> 2.3.0)
7
7
  nokogiri (~> 1.10.9)
@@ -13,12 +13,13 @@ class Mildom_analyze<Video_analyze
13
13
 
14
14
  def initialize(url)
15
15
  @VIDEOINFO_REQEST_URL="https://cloudac.mildom.com/nonolive/videocontent/playback/getPlaybackDetail?v_id="
16
+ @VIDEOINFO_REQEST_PARAMETER="&__platform=web"
16
17
  @CHAT_REQEST_URL="https://cloudac.mildom.com/nonolive/videocontent/chat/replay?video_id="
17
18
  @CHAT_REQEST_PARAMETER="&time_offset_ms="
18
19
 
19
20
  @video_url=url
20
21
  @video_id=videoid_get()
21
- @videoinfo,@videoinfo_request_status=request_json_parse(@VIDEOINFO_REQEST_URL+@video_id)
22
+ @videoinfo,@videoinfo_request_status=request_json_parse(@VIDEOINFO_REQEST_URL+@video_id+@VIDEOINFO_REQEST_PARAMETER)
22
23
  @chatlog_filepath="./"+@video_id+".txt"
23
24
  end
24
25
 
@@ -37,15 +37,15 @@ class Twitcasting_analyze<Video_analyze
37
37
 
38
38
  videoinfo={}
39
39
  videoinfo["user_name"]=@videoinfo_request_body.at_css(".tw-user-nav-name").text.strip
40
- videoinfo["video_title"]=@videoinfo_request_body.at_css("#movie_title_content").text
40
+ videoinfo["video_title"]=@videoinfo_request_body.at_css(".tw-player-page__title-editor-value").text
41
41
  videoinfo["video_time"]=@videoinfo_request_body.at_css(".tw-player-duration-time").text.strip
42
- videoinfo["video_start_time"]=@videoinfo_request_body.at_css(".tw-player-meta__status_item > time")[:datetime]
42
+ videoinfo["video_start_time"]=@videoinfo_request_body.at_css(".tw-player-meta__status_item > time").attribute('datetime').text
43
43
 
44
44
  videoinfo_polymer=@videoinfo_request_body.css(".tw-player-meta__status").css(".tw-player-meta__status_item")
45
45
  i=0
46
46
  videoinfo_polymer.each do |fact|
47
47
  if i==1 then
48
- videoinfo["total_view"]=fact.text.strip.split(":",2)[1]
48
+ videoinfo["total_view"]=fact.attribute('aria-label').text.split(":",2)[1].strip
49
49
  return videoinfo
50
50
  end
51
51
  i+=1
@@ -1,3 +1,3 @@
1
1
  module VideoChatGet
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.3"
3
3
  end
@@ -21,37 +21,40 @@ module VideoChatGet
21
21
  @@YOUTUBELIVE_IDENTFIER="https://www.youtube.com/watch?"
22
22
  @@TWITCASTING_IDENTFIER="https://twitcasting.tv/"
23
23
 
24
- def self.test
25
- "hello"
26
- end
27
-
24
+
28
25
  def self.url_route(url)
29
26
 
30
27
  if url.include?(@@OPENREC_IDENTFIER) then
31
28
  puts "identifier:openrec videourl:#{url}"
32
29
  obj=Openrec_analyze.new(url)
33
- obj.chat_scrape
34
- elsif url.include?(@@MILDOM_IDENTFIER) then
30
+ return obj.chat_scrape
31
+ end
32
+
33
+ if url.include?(@@MILDOM_IDENTFIER) then
35
34
  puts "identifier:mildom videourl:#{url}"
36
35
  obj=Mildom_analyze.new(url)
37
- obj.chat_scrape
38
- elsif url.include?(@@WHOWATCH_IDENTFIER) then
36
+ return obj.chat_scrape
37
+ end
38
+
39
+ if url.include?(@@WHOWATCH_IDENTFIER) then
39
40
  puts "identifier:whowatch videourl:#{url}"
40
41
  obj=Whowatch_analyze.new(url)
41
- obj.chat_scrape
42
- elsif url.include?(@@YOUTUBELIVE_IDENTFIER) then
42
+ return obj.chat_scrape
43
+ end
44
+
45
+ if url.include?(@@YOUTUBELIVE_IDENTFIER) then
43
46
  puts "identifier:youtube videourl:#{url}"
44
47
  obj=Youtubelive_analyze.new(url)
45
- obj.chat_scrape
46
- elsif url.include?(@@TWITCASTING_IDENTFIER) then
48
+ return obj.chat_scrape
49
+ end
50
+
51
+ if url.include?(@@TWITCASTING_IDENTFIER) then
47
52
  puts "identifier:twitcasting videourl:#{url}"
48
53
  obj=Twitcasting_analyze.new(url)
49
- obj.chat_scrape
50
- else
51
- puts "urlerr"
54
+ return obj.chat_scrape
52
55
  end
53
56
 
54
- "end"
57
+ return "url error"
55
58
  end
56
59
 
57
60
  end
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
7
7
  spec.name = "video_chat_get"
8
8
  spec.version = VideoChatGet::VERSION
9
9
  spec.authors = ["tf0101"]
10
- spec.email = ["tf0101sh@gmail.com"]
10
+ spec.email = ["tf0101_emaile"]
11
11
 
12
12
  spec.summary = %q{videochat scraping package}
13
13
  spec.description = %q{videochat scraping}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: video_chat_get
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - tf0101
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-16 00:00:00.000000000 Z
11
+ date: 2022-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -96,7 +96,7 @@ dependencies:
96
96
  version: 1.10.9
97
97
  description: videochat scraping
98
98
  email:
99
- - tf0101sh@gmail.com
99
+ - tf0101_emaile
100
100
  executables:
101
101
  - videochatget
102
102
  extensions: []