File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 1010from datetime import datetime
1111from datetime import timezone
1212from pathlib import Path
13+ from urllib .parse import urljoin
1314
1415import requests
1516
@@ -34,7 +35,7 @@ def steps(cls):
3435
3536 def check_new_catalog (self ):
3637 start_page = self .get_catalog_page_count ()
37- self .fetch_and_write (f" { self .url } / index.json" , CATALOG_INDEX )
38+ self .fetch_and_write (urljoin ( self .url , " index.json") , CATALOG_INDEX )
3839 end_page = self .get_catalog_page_count ()
3940 self .pages_to_collect = range (start_page , end_page )
4041
@@ -47,10 +48,10 @@ def collect_new_catalog(self):
4748 logger = self .log ,
4849 )
4950 for page in progress .iter (latest_pages ):
50- page_id = f"page{ page } "
51+ page_id = f"page{ page } .json "
5152 self .fetch_and_write (
52- url = f" { self .url } { page_id } .json" ,
53- path = PAGE_DIRECTORY / f" { page_id } .json" ,
53+ url = urljoin ( self .url , page_id ) ,
54+ path = PAGE_DIRECTORY / page_id ,
5455 )
5556
5657 def log (self , message ):
You can’t perform that action at this time.
0 commit comments