1
0
Fork 0
mirror of https://github.com/Phantop/dotfiles synced 2024-11-17 12:22:57 +00:00

Qute: AO3 easy downloader

This commit is contained in:
Phantop 2020-05-09 17:17:43 -04:00
parent a6e9411537
commit 9b1d634fe8

View file

@ -25,6 +25,7 @@ settings:
<Ctrl+w>: tab-close <Ctrl+w>: tab-close
gy: spawn -u ydl gy: spawn -u ydl
sa: spawn -u archive sa: spawn -u archive
sb: open javascript:(function($)%7Bfunction%20htmlEscape(str)%20%7Breturn%20String(str).replace(/&/g,%20'&amp;').replace(/%22/g,%20'&quot;').replace(/'/g,%20'&#39;').replace(/%3C/g,%20'&lt;').replace(/%3E/g,%20'&gt;');%7Dvar%20resultsDiv%20=%20document.createElement('div');resultsDiv.className%20=%20'ebookdownloads';resultsDiv.innerHTML%20+=%20'%3Cstyle%20scoped=%22scoped%22%3E%20.ebookdownloads%20p%20%7B%20margin:%200%20auto;%20padding:%200.25em;%20clear:%20both;%20%7D%20.ebookdownloads%20p:hover%20%7B%20background:%20rgba(0,0,0,0.15)%20!important;%20%7D%20.ebookdownloads%20%20p:nth-child(even)%20%7B%20background:%20rgba(0,0,0,0.05);%20%7D%20.ebookdownloads%20small.downloadtags%20%7B%20%20margin-top:%200.35em;%20%7D;%20.ebookdownloads%20.downloadtitle%20%7B%20cursor:default;%20%7D%20.ebookdownloads%20.downloadlinks%20%7B%20float:%20right;%7D%3C/style%3E';$('li.work,%20li.bookmark').each(function()%20%7Bvar%20options%20=%20%7B%22include_tags%22:false%7D;var%20download_url%20=%20'http://archiveofourown.org/downloads/';var%20author%20=%20$(this).find('[rel=author]:first').text();var%20author_parts%20=%20/([a-zA-Z0-9_%5Cs%5C-]*)%5Cs?(%5C((%5Cw*?)%5C))?/.exec(author);var%20pseud%20=%20author_parts[1];if%20(%20!pseud%20)%20%7Bpseud%20=%20'Anonymous';%7D/*download_url%20+=%20pseud.substring(0,%202)%20+%20'/'%20+%20pseud%20+%20'/';*/var%20summary%20=%20$(this).find('blockquote.summary').text();summary%20=%20$.trim(htmlEscape(summary));summary%20=%20summary.replace(/%5C.(%5CS)/g,%20'.%20%5C$1');%20%20var%20$match%20=%20$('.heading%20%3E%20a:first',%20this).attr('href').match(/works%5C/(%5Cd*)%5C/?/);%20%20if%20(!$match)%20%7B%20return;%20%7Dvar%20id%20=%20$match[1];download_url%20+=%20id%20+%20'/';var%20title%20=%20$(this).find('.heading%20%3E%20a:first').text();var%20filename%20=%20title.replace(/[%5E%5Cw%20_-]+/g,%20'').replace(/%20+/g,%20'%20');filename%20=%20filename.replace(/%5E(.%7B24%7D[%5Cw.]*).*/,%20'$1');download_url%20+=%20filename;var%20results%20=%20'%3Cp%3E%3Cspan%20class=%22downloadtitle%22%20title=%22'%20+%20summary%20+%20'%22%3E'%20+%20title%20+%20'%3C/span%3E:%20%3Cspan%20class=%22downloadlinks%22%3E%3Ca%20href=%22'%20+%20download_url%20+%20'.mobi%22%3Emobi%3C/a%3E%20%3Ca%20href=%22'%20+%20download_url%20+%20'.epub%22%3Eepub%3C/a%3E%20%3Ca%20href=%22'%20+%20download_url%20+%20'.pdf%22%3Epdf%3C/a%3E%20%3Ca%20href=%22'%20+%20download_url%20+%20'.html%22%3Ehtml%3C/a%3E%3C/span%3E';if%20(%20options.include_tags%20)%20%7Bvar%20tags%20=%20'';$(this).find('.fandoms%20.tag,%20.fandom,%20.relationships').each(function()%20%7Btags%20+=%20$.trim($(this).text())%20+%20',%20';%7D);results%20+=%20'%3Cbr/%3E%3Csmall%20class=%22downloadtags%22%3E'%20+%20tags.replace(/,%5Cs$/,%20'')%20+%20'%3C/small%3E';%7Dresults%20+=%20'%3C/p%3E';resultsDiv.innerHTML%20+=%20results;%7D);$('%23workskin').append('%3Cdiv%20id=%22mass_ebook_download_modal%22%3E');window.ao3modal.show('%23mass_ebook_download_modal');window.ao3modal.setContent(resultsDiv,%20'EBook%20Downloads');%7D)(jQuery);
sca: spawn -u switchadapta sca: spawn -u switchadapta
scd: spawn -u switchdark scd: spawn -u switchdark
sd: spawn -u open_download sd: spawn -u open_download