mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-03-16.git
synced 2024-08-15 00:53:18 +00:00
Add support for 'user' URLs in NewPipe import
This commit is contained in:
parent
5567e2843d
commit
19ed5bf993
3 changed files with 23 additions and 4 deletions
|
@ -51,8 +51,7 @@ def get_batch_channels(channels, db, refresh = false, pull_all_videos = true, ma
|
|||
|
||||
final = [] of String
|
||||
channels.size.times do
|
||||
ucid = finished_channel.receive
|
||||
if ucid
|
||||
if ucid = finished_channel.receive
|
||||
final << ucid
|
||||
end
|
||||
end
|
||||
|
|
|
@ -63,6 +63,12 @@ def channel_search(query, page, channel)
|
|||
canonical = document.xpath_node(%q(//link[@rel="canonical"]))
|
||||
end
|
||||
|
||||
if !canonical
|
||||
response = client.get("/user/#{channel}?disable_polymer=1&hl=en&gl=US")
|
||||
document = XML.parse_html(response.body)
|
||||
canonical = document.xpath_node(%q(//link[@rel="canonical"]))
|
||||
end
|
||||
|
||||
if !canonical
|
||||
return 0, [] of SearchItem
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue