Liru / tumblr-downloader

A command-line program that scrapes tumblr blogs, and downloads images and videos from several at once.
MIT License
147 stars 34 forks source link

Deleted videos create 283 byte files #56

Open andrew-kennedy opened 7 years ago

andrew-kennedy commented 7 years ago

Deleted videos create 283 byte files, and if these are deleted, they are redownloaded(recreated) the next time the tool is run. If a broken/empty video is found, shouldn't it be skipped without writing to disk?

Liru commented 7 years ago

Yeah, they should. Would you mind uploading the file? I'm curious as to what its contents are.

andrew-kennedy commented 7 years ago

turns out it's XML, here's the contents of one:

<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>42EA2F138CB173ED</RequestId><HostId>CJ6Ym9iGtmPI4ZIz60Tp6zLEvNUmYBmn7rg054AqmQ+DJM5PLZN2JIZuxDMST1UxsBXp8ObTG0=</HostId></Error>
CorentinB commented 5 years ago

A quick file would be to check if the file contain something like "Access Denied" before creating and writing the file.