Commit | Line | Data |
---|---|---|
4f6e317c | 1 | # thingy_grabber |
975060c9 OM |
2 | Script for archiving thingiverse things. Due to this being a glorified webscraper, it's going to be very fragile. |
3 | ||
4 | ## Usage: | |
4a98996b | 5 | ```` |
db8066ec | 6 | usage: thingy_grabber.py [-h] [-v] [-d DIRECTORY] {collection,thing,user,version} ... |
a7152c35 | 7 | |
4a98996b | 8 | positional arguments: |
db8066ec | 9 | {collection,thing,user,version} |
3522a3bf OM |
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 | |
db8066ec | 14 | version Show the current version |
4a98996b OM |
15 | |
16 | optional arguments: | |
3522a3bf OM |
17 | -h, --help show this help message and exit |
18 | -v, --verbose Be more verbose | |
d66f1f78 OM |
19 | -d DIRECTORY, --directory DIRECTORY |
20 | Target directory to download into | |
4a98996b | 21 | ```` |
3522a3bf | 22 | |
4a98996b OM |
23 | ### Things |
24 | `thingy_grabber.py thing thingid` | |
25 | This will create a directory named after the title of the thing with the given ID and download the files into it. | |
26 | ||
4a98996b | 27 | ### Collections |
3522a3bf | 28 | `thingy_grabber.py collection user_name collection_name` |
975060c9 OM |
29 | 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. |
30 | ||
a7152c35 | 31 | This will create a series of directorys `user-collection/thing-name` for each thing in the collection. |
a7152c35 OM |
32 | |
33 | 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. | |
34 | ||
3522a3bf OM |
35 | ### User designs |
36 | `thingy_grabber.py user_name` | |
37 | Where `user_name` is the name of a creator. | |
38 | ||
39 | This will create a series of directories `user designs/thing-name` for each thing that user has designed. | |
40 | ||
41 | 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. | |
42 | ||
975060c9 | 43 | ## Requirements |
c4388960 | 44 | python3, beautifulsoup4, requests, lxml |
975060c9 OM |
45 | |
46 | ## Current features: | |
47 | - can download an entire collection, creating seperate subdirs for each thing in the collection | |
e36c2a07 | 48 | - 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 |
3c82f75b | 49 | - 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. |
975060c9 | 50 | |
e36c2a07 OM |
51 | |
52 | ## Todo features (maybe): | |
975060c9 | 53 | - less perfunctory error checking / handling |
a7152c35 | 54 | - attempt to use -failed dirs for resuming |
e36c2a07 | 55 | - pull down images as well |