mirror of
https://github.com/cooperhammond/irs.git
synced 2024-12-22 17:35:28 +00:00
fix for updated yt render/metadata code
This commit is contained in:
parent
bf29194042
commit
a8a1c4d1c3
|
@ -197,8 +197,10 @@ module Youtube
|
|||
yt_initial_data : JSON::Any = JSON.parse("{}")
|
||||
|
||||
response_body.each_line do |line|
|
||||
if line.includes?("window[\"ytInitialData\"]")
|
||||
yt_initial_data = JSON.parse(line.split(" = ")[1][0..-2])
|
||||
# timestamp 11/8/2020:
|
||||
# youtube's html page has a line previous to this literally with 'scraper_data_begin' as a comment
|
||||
if line.includes?("var ytInitialData")
|
||||
yt_initial_data = JSON.parse(line.split(" = ")[1].delete(';'))
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue