Closed robobun7 closed 9 months ago
The backup utility used to work fine, but now every attempt to fetch a post just fails with the same error.
Caught exception while saving post [post number redacted]: Traceback (most recent call last): File "C:\py\tumblr-utils-master\tumblr_backup.py", line 1960, in save_post f.write(self.get_post()) ^^^^^^^^^^^^^^^ File "C:\py\tumblr-utils-master\tumblr_backup.py", line 1838, in get_post content = self.get_content() ^^^^^^^^^^^^^^^^^^ File "C:\py\tumblr-utils-master\tumblr_backup.py", line 1521, in get_content append_try('body') File "C:\py\tumblr-utils-master\tumblr_backup.py", line 1505, in append_try elt = re.sub(r'''(?i)(<img\s(?:[^>]*\s)?src\s*=\s*["'])(.*?)(["'][^>]*>)''', ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\[username redacted]\AppData\Local\Programs\Python\Python311\Lib\re\__init__.py", line 185, in sub return _compile(pattern, flags).sub(repl, string, count) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\py\tumblr-utils-master\tumblr_backup.py", line 1690, in get_inline_image saved_name = self.download_media(image_url, filename=image_filename) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\py\tumblr-utils-master\tumblr_backup.py", line 1782, in download_media return self._download_media_inner(url, get_path, path_parts, media_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\py\tumblr-utils-master\tumblr_backup.py", line 1808, in _download_media_inner wget_retrieve(url, dstpath, post_id=self.ident, post_timestamp=self.post['timestamp']) File "C:\py\tumblr-utils-master\wget.py", line 801, in __call__ _retrieve_loop(hstat, url, file, post_id, post_timestamp, adjust_basename, self.options, self.log) File "C:\py\tumblr-utils-master\wget.py", line 635, in _retrieve_loop err, doctype = gethttp(url, hstat, doctype, logger, retry_counter, options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\py\tumblr-utils-master\wget.py", line 253, in gethttp err, doctype = process_response(url, hstat, doctype, logger, retry_counter, resp) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\py\tumblr-utils-master\wget.py", line 267, in process_response contlen = resp.get_content_length('GET') ^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'HTTPResponse' object has no attribute 'get_content_length'
Duplicate of #15. You should try the latest pip-installable version, with pip install tumblr-backup. That will pull the correct version of urllib3 for you.
pip install tumblr-backup
The backup utility used to work fine, but now every attempt to fetch a post just fails with the same error.