Git Product home page Git Product logo

youtube-streaming-translator-python's Issues

Youtube DL

一直遇到这个问题,尝试了好多办法都无法解决。我应该怎么处理?
Connecting to youtube...
Traceback (most recent call last):
File "E:\youtube-streaming-translator-python-master\main.google.py", line 449, in
video = pafy.new(url)
File "E:\youtube-streaming-translator-python-master\venv\lib\site-packages\pafy\pafy.py", line 124, in new
return Pafy(url, basic, gdata, size, callback, ydl_opts=ydl_opts)
File "E:\youtube-streaming-translator-python-master\venv\lib\site-packages\pafy\backend_youtube_dl.py", line 31, in init
super(YtdlPafy, self).init(*args, **kwargs)
File "E:\youtube-streaming-translator-python-master\venv\lib\site-packages\pafy\backend_shared.py", line 97, in init
self._fetch_basic()
File "E:\youtube-streaming-translator-python-master\venv\lib\site-packages\pafy\backend_youtube_dl.py", line 53, in _fetch_basic
self._likes = self._ydl_info['like_count']
KeyError: 'like_count'

中英翻译

你好,我想知道这个怎么才能做到中英翻译。

        self.config = speech.types.RecognitionConfig(
            encoding=speech.enums.RecognitionConfig.AudioEncoding.LINEAR16,
            sample_rate_hertz=44100,
            language_code='en-US',
            max_alternatives=1,
            enable_automatic_punctuation=True,  # 启用标点符号
            diarization_config=speaker_diarization_config,  # 区分讲话人
            speech_contexts=speech_contexts  # 语音自适应

        )

我将上述的 language_code 写成了 en-US
但是我发现我实时翻译这个的时候,http://127.0.0.1:5000 这个网页没有任何输出

Speech2text timeout
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/local/Cellar/[email protected]/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "main.google.py", line 213, in run
    for response in responses:
UnboundLocalError: local variable 'responses' referenced before assignment
127.0.0.1 - - [14/Jan/2021 03:46:17] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [14/Jan/2021 03:46:26] "GET / HTTP/1.1" 200 -
146 146 0 145 145 4 0

而且运行对应的脚本出现以上错误,想知道这个错误是怎么原因造成的?

从谷歌API收到回复(翻译完成)的片段数 这两个字段总是 4和0
我这里播放的直播视频是英文视频可以请教一下如何解决这个问题吗?

Need help

What do these errors mean, which part did I did it wrong?
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.