tombulled / python-youtube-music

Python 3 YouTube Music Web API Client
GNU General Public License v3.0
64 stars 13 forks source link

ModuleNotFoundError: No module named 'youtube_dl.extractor.lazy_extractors' #5

Closed AndreasWidmer closed 4 years ago

AndreasWidmer commented 4 years ago

Hi,

thanks for this lib! I tried to use the YouTubeMusicDL class and get the following error:

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/init.py", line 4, in from .lazy_extractors import * ModuleNotFoundError: No module named 'youtube_dl.extractor.lazy_extractors'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "", line 1, in File "/Users/andreas/Projects/ytm/ytm/apis/YouTubeMusicDL/YouTubeMusicDL.py", line 239, in download_video return self._base._download \ File "/Users/andreas/Projects/ytm/ytm/apis/YouTubeMusicDL/YouTubeMusicDL.py", line 36, in _download import youtube_dl File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/init.py", line 43, in from .extractor import gen_extractors, list_extractors File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/init.py", line 9, in from .extractors import File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/extractors.py", line 55, in from .ard import ( File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/ard.py", line 8, in from .generic import GenericIE File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/generic.py", line 51, in from .smotri import SmotriIE File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/smotri.py", line 7, in import uuid File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/uuid.py", line 57, in _AIX = platform.system() == 'AIX' File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/platform.py", line 891, in system return uname().system File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/platform.py", line 857, in uname processor = _syscmd_uname('-p', '') File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/platform.py", line 613, in _syscmd_uname output = subprocess.check_output(('uname', option), File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 411, in check_output return run(popenargs, stdout=PIPE, timeout=timeout, check=True, File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 489, in run with Popen(*popenargs, **kwargs) as process: File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 768, in init raise ValueError("creationflags is only supported on Windows " ValueError: creationflags is only supported on Windows platforms

Do you have any idea why this error occurs? I simply did:

import ytm api = ytm.YouTubeMusicDL() api.download_album('MPREb_ctJ5HEJw8pg')

tombulled commented 4 years ago

Hi, what platform are you using?

YouTubeDL opens up a CMD window on Windows for FFMpeg which I attempted to hide using creationflags. I wasn't aware this was a platform specific trait and am happy to try and find an alternative option.

At the top of ytm/apis/YouTubeMusicDL/YouTubeMusicDL.py the code underneath the # Monkey patch ffmpeg's popen: comment is what's used. If you comment out the redirection of subprocess.Popen does it work?

AndreasWidmer commented 4 years ago

Oh yeah, OS is a good information, sorry about that missing information. I tried on unix systems: Ubuntu 20.04 and MacOs 10.15

It seems like commenting out that redirection works!

tombulled commented 4 years ago

That's great to hear, I'll leave it commented for now then until I have a working platform independent solution.

The YouTubeMusicDL class is still a work in progress and I aim to make it more robust soon 👍