mirror of
https://github.com/iv-org/invidious.git
synced 2025-09-20 17:26:29 -05:00
Merge 5029777f07c1c3429e20dfea26ba6e8f17f0db39 into 325e013e0d9e5670fa0df7635ff30a0ee029e05e
This commit is contained in:
commit
ae991f885a
@ -408,6 +408,7 @@
|
||||
"Default": "Default",
|
||||
"Music": "Music",
|
||||
"Gaming": "Gaming",
|
||||
"Livestreams": "Livestreams",
|
||||
"News": "News",
|
||||
"Movies": "Movies",
|
||||
"Download": "Download",
|
||||
|
@ -4,6 +4,8 @@ def fetch_trending(trending_type, region, locale)
|
||||
|
||||
plid = nil
|
||||
|
||||
browse_id = "FEtrending"
|
||||
|
||||
case trending_type.try &.downcase
|
||||
when "music"
|
||||
params = "4gINGgt5dG1hX2NoYXJ0cw%3D%3D"
|
||||
@ -11,12 +13,15 @@ def fetch_trending(trending_type, region, locale)
|
||||
params = "4gIcGhpnYW1pbmdfY29ycHVzX21vc3RfcG9wdWxhcg%3D%3D"
|
||||
when "movies"
|
||||
params = "4gIKGgh0cmFpbGVycw%3D%3D"
|
||||
when "livestreams"
|
||||
browse_id = "UC4R8DWoMoI7CAwX8_LjQHig"
|
||||
params = "EgdsaXZldGFikgEDCKEK"
|
||||
else # Default
|
||||
params = ""
|
||||
end
|
||||
|
||||
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)
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
</div>
|
||||
<div class="pure-u-1-3">
|
||||
<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">
|
||||
<% if trending_type == option %>
|
||||
<b><%= translate(locale, option) %></b>
|
||||
|
Loading…
x
Reference in New Issue
Block a user