Move old downloads sideways
[clinton/thingy_grabber.git] / README.md
1 # thingy_grabber
2 Script for archiving thingiverse things. Due to this being a glorified webscraper, it's going to be very fragile.
3
4 ## Usage:
5 ````
6 usage: thingy_grabber.py [-h] [-v] {collection,thing,user} ...
7
8 positional arguments:
9 {collection,thing,user}
10 Type of thing to download
11 collection Download an entire collection
12 thing Download a single thing.
13 user Download all things by a user
14
15 optional arguments:
16 -h, --help show this help message and exit
17 -v, --verbose Be more verbose
18 ````
19
20 ### Things
21 `thingy_grabber.py thing thingid`
22 This will create a directory named after the title of the thing with the given ID and download the files into it.
23
24
25 ### Collections
26 `thingy_grabber.py collection user_name collection_name`
27 Where `user_name` is the name of the creator of the collection (not nes. your name!) and `collection_name` is the name of the collection you want.
28
29 This will create a series of directorys `user-collection/thing-name` for each thing in the collection.
30
31 If for some reason a download fails, it will get moved sideways to `thing-name-failed` - this way if you rerun it, it will only reattmpt any failed things.
32
33 ### User designs
34 `thingy_grabber.py user_name`
35 Where `user_name` is the name of a creator.
36
37 This will create a series of directories `user designs/thing-name` for each thing that user has designed.
38
39 If for some reason a download fails, it will get moved sideways to `thing-name-failed` - this way if you rerun it, it will only reattmpt any failed things.
40
41 ## Requirements
42 python3, beautifulsoup4, requests, lxml
43
44 ## Current features:
45 - can download an entire collection, creating seperate subdirs for each thing in the collection
46 - If you run it again with the same settings, it will check for updated files and only update what has changed. This should make it suitible for syncing a collection on a cronjob
47 - If there is an updated file, the old directory will be moved to `name_timestamp` where `timestamp` is the last upload time of the old files. The code will then copy unchanged files across and download any new ones.
48
49
50 ## Todo features (maybe):
51 - less perfunctory error checking / handling
52 - attempt to use -failed dirs for resuming
53 - pull down images as well