Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: xbmcout instance has no attribute 'isatty' #49

Open
AliAghel opened this issue Nov 6, 2019 · 1 comment
Open

AttributeError: xbmcout instance has no attribute 'isatty' #49

AliAghel opened this issue Nov 6, 2019 · 1 comment

Comments

@AliAghel
Copy link

AliAghel commented Nov 6, 2019

The following python script works fine, but in the Kodi 18.3 got AttributeError: xbmcout instance has no attribute 'isatty'

ydl = youtube_dl.YoutubeDL({'outtmpl': '%(id)s%(ext)s'})

with ydl:
    result = ydl.extract_info(
        'https://www.bbc.com/persian/media-49522521',
        download=False
    )

if 'entries' in result:
    video = result['entries'][0]
else:
    video = result

video_url = video['url']
return video_url

here https://github.com/ruuk/script.module.youtube.dl/blob/master/lib/youtube_dl/extractor/common.py
if not self._downloader.params.get('no_color') and compat_os_name != 'nt' and sys.stderr.isatty():

I could not detect where the error comes from or some workaround. Any help would be appreciated.

@whynotzoidberg
Copy link

whynotzoidberg commented Jun 6, 2020

You can disable the coloring of the output, this should solve the issue.

  ydl_opts = {
        'no_color': True
  }
  with youtube_dl.YoutubeDL(ydl_opts) as ydl:
        result = ydl.extract_info(
            'https://www.bbc.com/persian/media-49522521',
             download=False
        )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants