MAsad789565 commited on
Commit
e35d7eb
1 Parent(s): 38e2473

Update networks/filepath_converter.py

Browse files
Files changed (1) hide show
  1. networks/filepath_converter.py +6 -1
networks/filepath_converter.py CHANGED
@@ -85,7 +85,12 @@ class UrlToFilepathConverter(FilepathConverter):
85
  self.output_root = self.output_root / "urls"
86
 
87
  def preprocess(self, url):
88
- filename = unquote(url.split("//")[1])
 
 
 
 
 
89
  return filename
90
 
91
 
 
85
  self.output_root = self.output_root / "urls"
86
 
87
  def preprocess(self, url):
88
+ # Ensure that the URL contains double forward slashes "//" before splitting
89
+ if "//" in url:
90
+ filename = unquote(url.split("//")[1])
91
+ else:
92
+ # Handle the case when "//" is not found in the URL
93
+ filename = "default_filename"
94
  return filename
95
 
96