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 genre channels
This commit is contained in:
parent
e1bf7fa6cc
commit
5632e58636
3 changed files with 93 additions and 32 deletions
|
@ -131,10 +131,23 @@ def fetch_channel(ucid, client, db, pull_all_videos = true)
|
|||
return channel
|
||||
end
|
||||
|
||||
def produce_channel_videos_url(ucid, page = 1)
|
||||
page = "#{page}"
|
||||
def produce_channel_videos_url(ucid, page = 1, auto_generated = nil)
|
||||
if auto_generated
|
||||
seed = Time.epoch(1525757349)
|
||||
|
||||
meta = "\x12\x06videos \x00\x30\x02\x38\x01\x60\x01\x6a\x00\x7a"
|
||||
until seed >= Time.now
|
||||
seed += 1.month
|
||||
end
|
||||
timestamp = seed - (page - 1).months
|
||||
|
||||
page = "#{timestamp.epoch}"
|
||||
switch = "\x36"
|
||||
else
|
||||
page = "#{page}"
|
||||
switch = "\x00"
|
||||
end
|
||||
|
||||
meta = "\x12\x06videos #{switch}\x30\x02\x38\x01\x60\x01\x6a\x00\x7a"
|
||||
meta += page.size.to_u8.unsafe_chr
|
||||
meta += page
|
||||
meta += "\xb8\x01\x00"
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
</div>
|
||||
<div class="pure-u-1 pure-u-md-3-5"></div>
|
||||
<div style="text-align:right;" class="pure-u-1 pure-u-md-1-5">
|
||||
<% if videos.size == 100 %>
|
||||
<% if videos.size == 100 || auto_generated %>
|
||||
<a href="/channel/<%= ucid %>?page=<%= page + 1 %>">Next page</a>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue