vimeo icon indicating copy to clipboard operation
vimeo copied to clipboard

TypeError: expected str, bytes or os.PathLike object, not URLError

Open CXPhoenix opened this issue 3 years ago • 3 comments

Hi I want to use the library in MacOS Catalina, but there's alway have the error as title.

But I can be used normally in Windows 10 earlier.

Is this related to the os?

here's my code:

import vimeo_dl as vimeo

def downloadBestFilms(urls, filePath):
    website = 'https://vimeo.com/'
    for url in urls:
        url = url.split('/')[-1]
        video = vimeo.new(website+url)
        best = video.getbest()
        best.download(filepath=filePath)

url = 'https://vimeo.com/516595785'
downloadBestFilms([url], '/Users/user/films')

and here's the error:

Traceback (most recent call last):
  File "/Users/fhshwork/crawler/src/crawlerTest.py", line 12, in <module>
    downloadBestFilms([url], '/Users/user/films')
  File "/Users/fhshwork/crawler/src/crawlerTest.py", line 8, in downloadBestFilms
    best = video.getbest()
  File "/Users/fhshwork/crawler/crawlerPy3.9/lib/python3.9/site-packages/vimeo_dl/vimeo_shared.py", line 161, in getbest
    return self._getbest()
  File "/Users/fhshwork/crawler/crawlerPy3.9/lib/python3.9/site-packages/vimeo_dl/vimeo_shared.py", line 148, in _getbest
    streams = self.streams
  File "/Users/fhshwork/crawler/crawlerPy3.9/lib/python3.9/site-packages/vimeo_dl/vimeo_shared.py", line 144, in streams
    self._process_streams()
  File "/Users/fhshwork/crawler/crawlerPy3.9/lib/python3.9/site-packages/vimeo_dl/vimeo_internal.py", line 60, in _process_streams
    self._fetch_data()
  File "/Users/fhshwork/crawler/crawlerPy3.9/lib/python3.9/site-packages/vimeo_dl/vimeo_internal.py", line 55, in _fetch_data
    self._info = _parse_config(self._conf_file, self.video_id)
  File "/Users/fhshwork/crawler/crawlerPy3.9/lib/python3.9/site-packages/vimeo_dl/extractor.py", line 72, in _parse_config
    fd = open(config)
TypeError: expected str, bytes or os.PathLike object, not URLError

CXPhoenix avatar Mar 05 '21 15:03 CXPhoenix

facing same error on ubuntu, in win10 it works fine.

zabir-nabil avatar Mar 31 '21 12:03 zabir-nabil

@CXPhoenix will check and try to fix ASAP.

r0oth3x49 avatar Apr 11 '21 07:04 r0oth3x49

I did some debugging, and it turns out the main issue is the compat_request:

        try:
            req = compat_request(self.url, headers=std_headers)
            response = compat_urlopen(req)
        except (compat_urlerr, compat_httperr) as e:
            return e

std_headers is not working for non-windows systems.

https://stackoverflow.com/questions/66889112/python3-urllib-vimeo-http-error-403-forbidden

zabir-nabil avatar Apr 11 '21 07:04 zabir-nabil