We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
database.py has a bug where
localfilename = hashlib.md5(origfile).hexdigest() + ext[0]
should be
localfilename = hashlib.md5(origfile).hexdigest() + ext
so all locally stored files have been given extension of "."
470 files have the issue.
The text was updated successfully, but these errors were encountered:
fixes bug #11
56d1a30
The bad files were corrected via:
1 import sqlite3, subprocess 2 3 dbpath = 'db/laamaj.db' 4 imgdir = 'db/img/' 5 6 con = sqlite3.connect(dbpath) 7 cur = con.cursor() 8 9 op = cur.execute("select ws_id, ws_url, ws_localfile from websites where ws_localfile like '%.' order by ws_id desc") 10 op = [x for x in op] 11 #op = cur.execute("select ws_id, ws_url, ws_localfile from websites where ws_id = '9455'") 12 13 for key, url, lfile in op: 14 print key, url, lfile 15 extension = url.split(u'.')[-1] 16 newfile = u'%s%s' % (lfile, extension) 17 cmd = u'mv %s%s %s%s' % (imgdir, lfile, imgdir, newfile) 18 retcode = subprocess.call(cmd, shell=True) 19 if retcode == 0: 20 script = "update websites set ws_localfile = '%s' where ws_id = '%s'" % (newfile, key) 21 print script 22 cur.execute(script) 23 con.commit() 24 else: 25 print 'failed to move'
Sorry, something went wrong.
No branches or pull requests
database.py has a bug where
should be
so all locally stored files have been given extension of "."
470 files have the issue.
The text was updated successfully, but these errors were encountered: