marklieberman / downloadstar

Download all items in a webpage that match a pattern
GNU General Public License v3.0
90 stars 16 forks source link

Check source elements audio/video tags for media #29

Closed Xiuywft closed 6 years ago

Xiuywft commented 6 years ago

Download Star doesn't find, and therefore won't download, mp3 files from https://exoticaproject.com/4/, whereas a right-click and "Save audio as..." in Firefox downloads them just fine, albeit one at a time.

The code looks like this, but I removed all the angle brackets, because five minutes of searching and reading didn't find me a way to quote a chunk of HTML without this window interpreting it

div class='record' a name='agogos_tictactoe' href='images/agogos_tictactoe.jpg' title='The A Go-Gos, Tic-Tac-Toe' img src='images_thumbnails/agogos_tictactoe.gif' /a div audio id='player2' controls style='max-width:100%;' source src='/4/audio/agogos_tictactoe.mp3' type='audio/mp3' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ THIS line is not understood by Download Star

/audio /div The A Go-Gos: "Tic-Tac-Toe" br/ [DB-3665A] br/ br/ Motifs: a href='index.php?name=randb_cover' target='_self' R&B cover /a a href='index.php?name=organ' target='_self' Organ /a a href='index.php?name=overt_booker_t_and_the_mgs_influence' target='_self' Overt Booker T & MGs influence /a div style='position:absolute;left:1px;bottom:0px;font-size:8px;color:gray' a href='/4/#agogos_tictactoe' # /a /div div style='position:absolute;right:1px;bottom:0px;font-size:8px;color:gray' added: 2016-03-11 /div ...

marklieberman commented 6 years ago

Scrape.js currently doesn't look at source elements inside audio/video tags. That is an oversight and will have to be fixed.

OkanEsen commented 6 years ago

I just looked inside scrape.js and the scraping should work according to https://github.com/marklieberman/downloadstar/blob/master/src/content/scrape.js#L104.

I also just tested it on the same page with these settings and the addon is finding every .mp3 file on the page and downloads it successfully.

Are you sure you're selecting the right option for the scraping @Xiuywft?

ssokolow commented 6 years ago

@Xiuywft

To quote source code in Markdown, either indent it by four spaces or use "fenced code blocks". The latter look like this:

```html
<html lang="en">
    <body>Blah blah blah.</body>
</html>
```

...and the result looks like this:

<html lang="en">
    <body>Blah blah blah.</body>
</html>

(To show what a fenced code block's raw source looks like, I also indented it by four spaces. The html after the initial three backticks is optional and explicitly specifies the kind of code colorization to use.)

marklieberman commented 6 years ago

Closed by 327f8faaede36b5a89cc4aae7a41fa735b06570d