mirror of
https://github.com/iv-org/invidious.git
synced 2025-11-23 01:45:41 +00:00
Add host language to YouTube requests
This commit is contained in:
@@ -46,7 +46,7 @@ def fetch_playlist_videos(plid, page, video_count)
|
||||
if page > 1
|
||||
videos = [] of PlaylistVideo
|
||||
else
|
||||
response = client.get("/playlist?list=#{plid}&disable_polymer=1")
|
||||
response = client.get("/playlist?list=#{plid}&gl=US&hl=en&disable_polymer=1")
|
||||
document = XML.parse_html(response.body)
|
||||
nodeset = document.xpath_nodes(%q(.//tr[contains(@class, "pl-video")]))
|
||||
|
||||
@@ -142,7 +142,7 @@ def fetch_playlist(plid)
|
||||
plid = "UU#{plid.lchop("UC")}"
|
||||
end
|
||||
|
||||
response = client.get("/playlist?list=#{plid}&disable_polymer=1")
|
||||
response = client.get("/playlist?list=#{plid}&hl=en&disable_polymer=1")
|
||||
if response.status_code != 200
|
||||
raise "Invalid playlist."
|
||||
end
|
||||
|
||||
@@ -89,7 +89,7 @@ def search(query, page = 1, search_params = produce_search_params(content_type:
|
||||
return {0, [] of SearchItem}
|
||||
end
|
||||
|
||||
html = client.get("/results?q=#{URI.escape(query)}&page=#{page}&sp=#{search_params}&disable_polymer=1").body
|
||||
html = client.get("/results?q=#{URI.escape(query)}&page=#{page}&sp=#{search_params}&hl=en&disable_polymer=1").body
|
||||
if html.empty?
|
||||
return {0, [] of SearchItem}
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user