From 03f5f3f15f3a0a0426a1709c095742e8b29d706f Mon Sep 17 00:00:00 2001 From: Nemo Date: Wed, 28 Aug 2024 21:08:11 +0530 Subject: [PATCH] Adds wind and truth audiobook download --- .gitignore | 2 ++ wat.rb | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/.gitignore b/.gitignore index 5e0d81c..242be4a 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ darkone/ /mythwalker/*.html lost-metal/ wat/*.html +wat/*.opus +wat/*.json diff --git a/wat.rb b/wat.rb index fdb96c9..d37e8d7 100644 --- a/wat.rb +++ b/wat.rb @@ -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)