Beispiel #1
0
 def get_blob_from_url(self, url: str) -> ImageResponseDTO:
     req = requests.get(url, headers=self.headers)
     result = ImageResponseDTO()
     result.blob = req.content
     result.mime = req.headers['content-type']
     result.ext = StringHelper.get_extension_from_url(url)
     result.length = int(req.headers['content-length'])
     return result
Beispiel #2
0
 def test_url_parse(self):
     self.assertEqual(
         '.png',
         StringHelper.get_extension_from_url(
             'https://www.hltv.org/img/static/flags/300x200/FR.png'))