diff options
| author | Omar Roth <omarroth@hotmail.com> | 2018-02-06 17:30:53 -0600 |
|---|---|---|
| committer | Omar Roth <omarroth@hotmail.com> | 2018-02-06 17:30:53 -0600 |
| commit | d4c88f2844001b5dc16de5bc1b1407784152616d (patch) | |
| tree | 4bd37dab9ea940e64cebec90386b08a8070bebb2 | |
| parent | 6167ce30b0bbe42973ca0c453dc32d0972303436 (diff) | |
| download | invidious-d4c88f2844001b5dc16de5bc1b1407784152616d.tar.gz invidious-d4c88f2844001b5dc16de5bc1b1407784152616d.tar.bz2 invidious-d4c88f2844001b5dc16de5bc1b1407784152616d.zip | |
Fix watch for videos that don't have fmt_stream
| -rw-r--r-- | src/invidious.cr | 16 | ||||
| -rw-r--r-- | src/views/search.ecr | 2 |
2 files changed, 11 insertions, 7 deletions
diff --git a/src/invidious.cr b/src/invidious.cr index 973d0482..9eecf106 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -151,9 +151,11 @@ get "/watch" do |env| fmt_stream << HTTP::Params.parse(string) end - if fmt_stream[0]["s"]? - fmt_stream.each do |fmt| - fmt["url"] = "#{fmt["url"]}&signature=#{decrypt_signature(fmt["s"])}" + if fmt_stream[0]? + if fmt_stream[0]["s"]? + fmt_stream.each do |fmt| + fmt["url"] = "#{fmt["url"]}&signature=#{decrypt_signature(fmt["s"])}" + end end end @@ -167,9 +169,11 @@ get "/watch" do |env| end end - if adaptive_fmts[0]["s"]? - adaptive_fmts.each do |fmt| - fmt["url"] = "#{fmt["url"]}&signature=#{decrypt_signature(fmt["s"])}" + if adaptive_fmts[0]? + if adaptive_fmts[0]["s"]? + adaptive_fmts.each do |fmt| + fmt["url"] = "#{fmt["url"]}&signature=#{decrypt_signature(fmt["s"])}" + end end end diff --git a/src/views/search.ecr b/src/views/search.ecr index da585366..105e25af 100644 --- a/src/views/search.ecr +++ b/src/views/search.ecr @@ -7,7 +7,7 @@ <% slice.each do |video| %> <div class="pure-u-1 pure-u-md-1-4"> <div style="margin:1em;"> - <a style="width:100%;" class="link" href="/watch?v=<%= video["link"] %>"> + <a style="width:100%;" class="link" href="<%= video["link"] %>"> <img style="width:100%;" src="<%= video["thumbnail"] %>"/> <%= video["title"] %> </a> |
