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 | ```` |
3522a3bf | 6 | usage: thingy_grabber.py [-h] [-v] {collection,thing,user} ... |
a7152c35 | 7 | |
4a98996b | 8 | positional arguments: |
3522a3bf OM |
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 | |
4a98996b OM |
14 | |
15 | optional arguments: | |
3522a3bf OM |
16 | -h, --help show this help message and exit |
17 | -v, --verbose Be more verbose | |
4a98996b | 18 | ```` |
3522a3bf | 19 | |
4a98996b OM |
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 | |
3522a3bf | 26 | `thingy_grabber.py collection user_name collection_name` |
975060c9 OM |
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 | ||
a7152c35 | 29 | This will create a series of directorys `user-collection/thing-name` for each thing in the collection. |
a7152c35 OM |
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 | ||
3522a3bf OM |
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 | ||
975060c9 | 41 | ## Requirements |
c4388960 | 42 | python3, beautifulsoup4, requests, lxml |
975060c9 OM |
43 | |
44 | ## Current features: | |
45 | - can download an entire collection, creating seperate subdirs for each thing in the collection | |
e36c2a07 | 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 |
3c82f75b | 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. |
975060c9 | 48 | |
e36c2a07 OM |
49 | |
50 | ## Todo features (maybe): | |
975060c9 | 51 | - less perfunctory error checking / handling |
a7152c35 | 52 | - attempt to use -failed dirs for resuming |
e36c2a07 | 53 | - pull down images as well |