mirror of
https://github.com/captn3m0/cosmere-books.git
synced 2024-09-19 12:56:59 +00:00
Adds wind and truth audiobook download
This commit is contained in:
parent
4411b032ed
commit
03f5f3f15f
2
.gitignore
vendored
2
.gitignore
vendored
@ -13,3 +13,5 @@ darkone/
|
||||
/mythwalker/*.html
|
||||
lost-metal/
|
||||
wat/*.html
|
||||
wat/*.opus
|
||||
wat/*.json
|
||||
|
7
wat.rb
7
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)
|
||||
|
Loading…
Reference in New Issue
Block a user