Skip to content

Commit d25c670

Browse files
author
Justin Greer
committed
Disable reading m3u8 files until we have time to bring it up to date.
1 parent 9583298 commit d25c670

File tree

1 file changed

+42
-38
lines changed

1 file changed

+42
-38
lines changed

lib/m3uzi.rb

Lines changed: 42 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -28,44 +28,48 @@ def initialize
2828
# Read/Write M3U8 Files
2929
#-------------------------------------
3030

31-
def self.read(path)
32-
m3u = self.new
33-
lines = ::File.readlines(path)
34-
lines.each_with_index do |line, i|
35-
case type(line)
36-
when :tag
37-
name, value = parse_general_tag(line)
38-
m3u.add_tag do |tag|
39-
tag.name = name
40-
tag.value = value
41-
end
42-
when :info
43-
duration, description = parse_file_tag(line)
44-
m3u.add_file do |file|
45-
file.path = lines[i+1].strip
46-
file.duration = duration
47-
file.description = description
48-
end
49-
m3u.final_media_file = false
50-
when :stream
51-
attributes = parse_stream_tag(line)
52-
m3u.add_stream do |stream|
53-
stream.path = lines[i+1].strip
54-
attributes.each_pair do |k,v|
55-
k = k.to_s.downcase.sub('-','_')
56-
next unless [:bandwidth, :program_id, :codecs, :resolution].include?(k)
57-
v = $1 if v.to_s =~ /^"(.*)"$/
58-
stream.send("#{k}=", v)
59-
end
60-
end
61-
when :final
62-
m3u.final_media_file = true
63-
else
64-
next
65-
end
66-
end
67-
m3u
68-
end
31+
##
32+
## For now, reading m3u8 files is not keeping up to date with writing, so we're
33+
## disabling it in this version. (Possibly to be re-introduced in the future.)
34+
##
35+
# def self.read(path)
36+
# m3u = self.new
37+
# lines = ::File.readlines(path)
38+
# lines.each_with_index do |line, i|
39+
# case type(line)
40+
# when :tag
41+
# name, value = parse_general_tag(line)
42+
# m3u.add_tag do |tag|
43+
# tag.name = name
44+
# tag.value = value
45+
# end
46+
# when :info
47+
# duration, description = parse_file_tag(line)
48+
# m3u.add_file do |file|
49+
# file.path = lines[i+1].strip
50+
# file.duration = duration
51+
# file.description = description
52+
# end
53+
# m3u.final_media_file = false
54+
# when :stream
55+
# attributes = parse_stream_tag(line)
56+
# m3u.add_stream do |stream|
57+
# stream.path = lines[i+1].strip
58+
# attributes.each_pair do |k,v|
59+
# k = k.to_s.downcase.sub('-','_')
60+
# next unless [:bandwidth, :program_id, :codecs, :resolution].include?(k)
61+
# v = $1 if v.to_s =~ /^"(.*)"$/
62+
# stream.send("#{k}=", v)
63+
# end
64+
# end
65+
# when :final
66+
# m3u.final_media_file = true
67+
# else
68+
# next
69+
# end
70+
# end
71+
# m3u
72+
# end
6973

7074
def write_to_io(io_stream)
7175
check_version_restrictions

0 commit comments

Comments
 (0)