mirror of
https://github.com/iv-org/invidious.git
synced 2025-09-20 17:26:29 -05:00
Add Livestreams to trending page
This commit is contained in:
parent
325e013e0d
commit
5029777f07
@ -408,6 +408,7 @@
|
|||||||
"Default": "Default",
|
"Default": "Default",
|
||||||
"Music": "Music",
|
"Music": "Music",
|
||||||
"Gaming": "Gaming",
|
"Gaming": "Gaming",
|
||||||
|
"Livestreams": "Livestreams",
|
||||||
"News": "News",
|
"News": "News",
|
||||||
"Movies": "Movies",
|
"Movies": "Movies",
|
||||||
"Download": "Download",
|
"Download": "Download",
|
||||||
|
@ -4,6 +4,8 @@ def fetch_trending(trending_type, region, locale)
|
|||||||
|
|
||||||
plid = nil
|
plid = nil
|
||||||
|
|
||||||
|
browse_id = "FEtrending"
|
||||||
|
|
||||||
case trending_type.try &.downcase
|
case trending_type.try &.downcase
|
||||||
when "music"
|
when "music"
|
||||||
params = "4gINGgt5dG1hX2NoYXJ0cw%3D%3D"
|
params = "4gINGgt5dG1hX2NoYXJ0cw%3D%3D"
|
||||||
@ -11,12 +13,15 @@ def fetch_trending(trending_type, region, locale)
|
|||||||
params = "4gIcGhpnYW1pbmdfY29ycHVzX21vc3RfcG9wdWxhcg%3D%3D"
|
params = "4gIcGhpnYW1pbmdfY29ycHVzX21vc3RfcG9wdWxhcg%3D%3D"
|
||||||
when "movies"
|
when "movies"
|
||||||
params = "4gIKGgh0cmFpbGVycw%3D%3D"
|
params = "4gIKGgh0cmFpbGVycw%3D%3D"
|
||||||
|
when "livestreams"
|
||||||
|
browse_id = "UC4R8DWoMoI7CAwX8_LjQHig"
|
||||||
|
params = "EgdsaXZldGFikgEDCKEK"
|
||||||
else # Default
|
else # Default
|
||||||
params = ""
|
params = ""
|
||||||
end
|
end
|
||||||
|
|
||||||
client_config = YoutubeAPI::ClientConfig.new(region: region)
|
client_config = YoutubeAPI::ClientConfig.new(region: region)
|
||||||
initial_data = YoutubeAPI.browse("FEtrending", params: params, client_config: client_config)
|
initial_data = YoutubeAPI.browse(browse_id, params: params, client_config: client_config)
|
||||||
|
|
||||||
items, _ = extract_items(initial_data)
|
items, _ = extract_items(initial_data)
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="pure-u-1-3">
|
<div class="pure-u-1-3">
|
||||||
<div class="pure-g" style="text-align:right">
|
<div class="pure-g" style="text-align:right">
|
||||||
<% {"Default", "Music", "Gaming", "Movies"}.each do |option| %>
|
<% {"Default", "Music", "Gaming", "Movies", "Livestreams"}.each do |option| %>
|
||||||
<div class="pure-u-1 pure-md-1-3">
|
<div class="pure-u-1 pure-md-1-3">
|
||||||
<% if trending_type == option %>
|
<% if trending_type == option %>
|
||||||
<b><%= translate(locale, option) %></b>
|
<b><%= translate(locale, option) %></b>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user