Skip to content

Commit

Permalink
fix latest downloads for fenix
Browse files Browse the repository at this point in the history
  • Loading branch information
salilmishra23 committed Jan 30, 2023
1 parent ee197b8 commit 40f42c6
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion mozdownload/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,20 @@ def get_latest_build_date(self):
if self.application not in ('fenix', 'fennec'):
url = urljoin(self.base_url, 'nightly', 'latest-%s/' % self.branch)
elif self.application == 'fenix':
url = urljoin(self.base_url, 'nightly/')
years = self._create_directory_parser(urljoin(self.base_url, 'nightly/'))
years.entries.sort()
months = self._create_directory_parser(urljoin(self.base_url, 'nightly',
years.entries[-1] + '/'))
months.entries.sort()

url = urljoin(self.base_url, 'nightly', years.entries[-1],
months.entries[-1] + '/')
parser = self._create_directory_parser(url)
parser.entries = parser.filter(r'.*%s' % self.platform_regex)
parser.entries.sort()

date = ''.join(parser.entries[-1].split('-')[:6])
return datetime.strptime(date, '%Y%m%d%H%M%S')
else:
url = urljoin(self.base_url, 'nightly', 'latest-%s-%s/' %
(self.branch, self.platform))
Expand Down

0 comments on commit 40f42c6

Please sign in to comment.