diff options
| author | Omar Roth <omarroth@hotmail.com> | 2018-06-02 20:03:54 -0500 |
|---|---|---|
| committer | Omar Roth <omarroth@hotmail.com> | 2018-06-02 20:03:54 -0500 |
| commit | 581056ae390bc209516900db107a3beec37d9271 (patch) | |
| tree | 753518114335a8dcc53dacfd18934df0da026aaf /src | |
| parent | 6d0079e886048fe72eaee48fd29ca9bd10a1b5a5 (diff) | |
| download | invidious-581056ae390bc209516900db107a3beec37d9271.tar.gz invidious-581056ae390bc209516900db107a3beec37d9271.tar.bz2 invidious-581056ae390bc209516900db107a3beec37d9271.zip | |
Future-proof extractors
Diffstat (limited to 'src')
| -rw-r--r-- | src/helpers.cr | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/helpers.cr b/src/helpers.cr index 3205176f..c0acf3df 100644 --- a/src/helpers.cr +++ b/src/helpers.cr @@ -185,14 +185,14 @@ def elapsed_text(elapsed) end def fetch_video(id, client) - info = client.get("/get_video_info?video_id=#{id}&el=detailpage&ps=default&eurl=&gl=US&hl=en").body - html = client.get("/watch?v=#{id}&bpctr=#{Time.new.epoch + 2000}").body + info = client.get("/get_video_info?video_id=#{id}&el=detailpage&ps=default&eurl=&gl=US&hl=en&disable_polymer=1").body + html = client.get("/watch?v=#{id}&bpctr=#{Time.new.epoch + 2000}&disable_polymer=1").body html = XML.parse_html(html) info = HTTP::Params.parse(info) if info["reason"]? - info = client.get("/get_video_info?video_id=#{id}&ps=default&eurl=&gl=US&hl=en").body + info = client.get("/get_video_info?video_id=#{id}&ps=default&eurl=&gl=US&hl=en&disable_polymer=1").body info = HTTP::Params.parse(info) if info["reason"]? raise info["reason"] @@ -273,7 +273,7 @@ def get_video(id, client, db, refresh = true) end def search(query, client) - html = client.get("https://www.youtube.com/results?q=#{query}&sp=EgIQAVAU").body + html = client.get("https://www.youtube.com/results?q=#{query}&sp=EgIQAVAU&disable_polymer=1").body html = XML.parse_html(html) |
