1b09267876
Configuration Settings can now be changed with the -e command line argument execution of 4grab has been moved to 4grab.py, but should also still work with download.py
27 lines
804 B
Python
Executable file
27 lines
804 B
Python
Executable file
#!/bin/env python
|
|
import optparse
|
|
import sys
|
|
|
|
import config
|
|
import download
|
|
|
|
parser = optparse.OptionParser()
|
|
|
|
parser.add_option("-e", nargs=2, dest="confval", metavar="VALUE")
|
|
|
|
(options, args) = parser.parse_args()
|
|
|
|
if options.confval:
|
|
if not config.Configuration().option_exists(options.confval[0]):
|
|
print "%s: error: %s is not a valid configuration option" % (sys.argv[0], options.confval[0])
|
|
exit(1)
|
|
print "Setting", options.confval[0], "to", options.confval[1]
|
|
config.Configuration().set_option(options.confval[0], options.confval[1])
|
|
config.Configuration().save()
|
|
exit(0)
|
|
|
|
base_url = "http://boards.4chan.org/%s/" % (config.Configuration().get_category())
|
|
|
|
t = download.get_thread_links(base_url)
|
|
t = download.get_image_links(base_url, t)
|
|
download.get_images(t)
|