Adds wind and truth audiobook download

This commit is contained in:
Nemo 2024-08-28 21:08:11 +05:30
parent 4411b032ed
commit 03f5f3f15f
2 changed files with 9 additions and 0 deletions

2
.gitignore vendored
View File

@ -13,3 +13,5 @@ darkone/
/mythwalker/*.html
lost-metal/
wat/*.html
wat/*.opus
wat/*.json

7
wat.rb
View File

@ -31,8 +31,12 @@ end
# Now we have all the files
html = ''
audiobook_links = []
(1..(links.length)).each do |i|
page = Nokogiri::HTML(open("wat/#{i}.html")).css('article-content')
page.css('a[href^="https://soundcloud.com/macaudio-2/"]').each do |sc_url|
audiobook_links << sc_url['href']
end
start = ending = false
page.children.each do |e|
if e.name == 'h3'
@ -52,4 +56,7 @@ end
File.open('books/wat.html', 'w') { |file| file.write(html) }
puts '[html] Generated HTML file'
File.open('books/wat-audio.txt', 'w') { |file| file.write(audiobook_links.join("\n")) }
puts '[html] Generated Audiobook Listing'
generate('wat', :all)