diff --git a/FAAPI/FAAPI.py b/FAAPI/FAAPI.py index c940ce1..8cf7f29 100644 --- a/FAAPI/FAAPI.py +++ b/FAAPI/FAAPI.py @@ -339,6 +339,14 @@ class User: # Get all the submissions on this page for item in soup.select('.gallery figure'): sub = Submission.new_or_cached(self._api, int(item.get('id')[4:])) # IDs look like 'sid-35908275', so we just skip the 'sid-' + + # Try cache the preview URL early + try: + sub._preview_url = 'https:' + item.select('img')[0].get('src') + sub._has_preview = True + except IndexError: + sub._has_preview = False + submissions.append(sub) return submissions @@ -360,6 +368,14 @@ class User: # Get all the submissions on this page for item in soup.select('.gallery figure'): sub = Submission.new_or_cached(self._api, int(item.get('id')[4:])) # IDs look like 'sid-35908275', so we just skip the 'sid-' + + # Try cache the preview URL early + try: + sub._preview_url = 'https:' + item.select('img')[0].get('src') + sub._has_preview = True + except IndexError: + sub._has_preview = False + submissions.append(sub) return submissions diff --git a/setup.py b/setup.py index ea34de8..7422050 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name='FAAPI', - version='0.4.0', + version='0.4.2', packages=find_packages(), url='https://tem.party/gitea/tom/FAAPI', license='WTFPL',