mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-22 16:19:53 +05:30
Extractors: Don't error if AuthorId does not exist (#3869)
Some playlist author's don't have a YouTube channel, so does movies. This caused various extractors (related videos, search) to fail. Closes the following issues: 2530, 3349, 3766, 3812, 4133
This commit is contained in:
commit
3b4358dbd4
@ -82,11 +82,19 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="video-card-row flexible">
|
<div class="video-card-row flexible">
|
||||||
<div class="flex-left"><a href="/channel/<%= item.ucid %>">
|
<div class="flex-left">
|
||||||
<p class="channel-name" dir="auto"><%= HTML.escape(item.author) %>
|
<% if !item.ucid.to_s.empty? %>
|
||||||
<%- if author_verified %> <i class="icon ion ion-md-checkmark-circle"></i><% end -%>
|
<a href="/channel/<%= item.ucid %>">
|
||||||
</p>
|
<p class="channel-name" dir="auto"><%= HTML.escape(item.author) %>
|
||||||
</a></div>
|
<%- if author_verified %> <i class="icon ion ion-md-checkmark-circle"></i><% end -%>
|
||||||
|
</p>
|
||||||
|
</a>
|
||||||
|
<% else %>
|
||||||
|
<p class="channel-name" dir="auto"><%= HTML.escape(item.author) %>
|
||||||
|
<%- if author_verified %> <i class="icon ion ion-md-checkmark-circle"></i><% end -%>
|
||||||
|
</p>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% when Category %>
|
<% when Category %>
|
||||||
<% else %>
|
<% else %>
|
||||||
@ -160,11 +168,19 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="video-card-row flexible">
|
<div class="video-card-row flexible">
|
||||||
<div class="flex-left"><a href="/channel/<%= item.ucid %>">
|
<div class="flex-left">
|
||||||
<p class="channel-name" dir="auto"><%= HTML.escape(item.author) %>
|
<% if !item.ucid.to_s.empty? %>
|
||||||
<%- if author_verified %> <i class="icon ion ion-md-checkmark-circle"></i><% end -%>
|
<a href="/channel/<%= item.ucid %>">
|
||||||
</p>
|
<p class="channel-name" dir="auto"><%= HTML.escape(item.author) %>
|
||||||
</a></div>
|
<%- if author_verified %> <i class="icon ion ion-md-checkmark-circle"></i><% end -%>
|
||||||
|
</p>
|
||||||
|
</a>
|
||||||
|
<% else %>
|
||||||
|
<p class="channel-name" dir="auto"><%= HTML.escape(item.author) %>
|
||||||
|
<%- if author_verified %> <i class="icon ion ion-md-checkmark-circle"></i><% end -%>
|
||||||
|
</p>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
|
||||||
<%= rendered "components/video-context-buttons" %>
|
<%= rendered "components/video-context-buttons" %>
|
||||||
</div>
|
</div>
|
||||||
|
@ -346,7 +346,7 @@ we're going to need to do it here in order to allow for translations.
|
|||||||
|
|
||||||
<h5 class="pure-g">
|
<h5 class="pure-g">
|
||||||
<div class="pure-u-14-24">
|
<div class="pure-u-14-24">
|
||||||
<% if rv["ucid"]? %>
|
<% if !rv["ucid"].empty? %>
|
||||||
<b style="width:100%"><a href="/channel/<%= rv["ucid"] %>"><%= rv["author"]? %><% if rv["author_verified"]? == "true" %> <i class="icon ion ion-md-checkmark-circle"></i><% end %></a></b>
|
<b style="width:100%"><a href="/channel/<%= rv["ucid"] %>"><%= rv["author"]? %><% if rv["author_verified"]? == "true" %> <i class="icon ion ion-md-checkmark-circle"></i><% end %></a></b>
|
||||||
<% else %>
|
<% else %>
|
||||||
<b style="width:100%"><%= rv["author"]? %><% if rv["author_verified"]? == "true" %> <i class="icon ion ion-md-checkmark-circle"></i><% end %></b>
|
<b style="width:100%"><%= rv["author"]? %><% if rv["author_verified"]? == "true" %> <i class="icon ion ion-md-checkmark-circle"></i><% end %></b>
|
||||||
|
@ -822,9 +822,9 @@ module HelperExtractors
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Retrieves the ID required for querying the InnerTube browse endpoint.
|
# Retrieves the ID required for querying the InnerTube browse endpoint.
|
||||||
# Raises when it's unable to do so
|
# Returns an empty string when it's unable to do so
|
||||||
def self.get_browse_id(container)
|
def self.get_browse_id(container)
|
||||||
return container.dig("navigationEndpoint", "browseEndpoint", "browseId").as_s
|
return container.dig?("navigationEndpoint", "browseEndpoint", "browseId").try &.as_s || ""
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user