diff options
| author | Omar Roth <omarroth@hotmail.com> | 2018-09-26 19:47:06 -0500 |
|---|---|---|
| committer | Omar Roth <omarroth@hotmail.com> | 2018-09-26 19:47:06 -0500 |
| commit | 4fb275ec6e55659f487eca244195a2f2cd7f27df (patch) | |
| tree | 3cd73777de306db0c161ac5462fa6cf354d14997 | |
| parent | f99b2cdf011758e078939c6ab26894509390f705 (diff) | |
| download | invidious-4fb275ec6e55659f487eca244195a2f2cd7f27df.tar.gz invidious-4fb275ec6e55659f487eca244195a2f2cd7f27df.tar.bz2 invidious-4fb275ec6e55659f487eca244195a2f2cd7f27df.zip | |
Get more video information when possible
| -rw-r--r-- | src/invidious/videos.cr | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/invidious/videos.cr b/src/invidious/videos.cr index cd423b68..87686a51 100644 --- a/src/invidious/videos.cr +++ b/src/invidious/videos.cr @@ -540,8 +540,13 @@ def fetch_video(id, proxies) proxy = HTTPProxy.new(proxy_host: proxy[:ip], proxy_port: proxy[:port]) client.set_proxy(proxy) + proxy_info = client.get("/get_video_info?video_id=#{id}&el=detailpage&ps=default&eurl=&gl=US&hl=en&disable_polymer=1") + proxy_info = HTTP::Params.parse(proxy_info.body) + + if proxy_info["reason"]? proxy_info = client.get("/get_video_info?video_id=#{id}&ps=default&eurl=&gl=US&hl=en&disable_polymer=1") proxy_info = HTTP::Params.parse(proxy_info.body) + end if !proxy_info["reason"]? proxy_html = client.get("/watch?v=#{id}&bpctr=#{Time.new.epoch + 2000}&gl=US&hl=en&disable_polymer=1") |
