SubMe icon indicating copy to clipboard operation
SubMe copied to clipboard

TypeError: the JSON object must be str, bytes or bytearray, not NoneType

Open dropitlikecross opened this issue 3 years ago • 3 comments

Conversion completed.
Use Auditok to detect speech regions.
Auditok detection completed.
"/tmp/tmppaa509k1.wav" has been deleted.

Converting speech regions to short-term fragments.
Converting: 100% |##############################################| Time:  0:00:51

Sending short-term fragments to Google Speech V2 API and getting result.
Speech-to-Text: 100% |##########################################| Time:  0:06:25
Traceback (most recent call last):
  File "/usr/local/bin/autosub", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/dist-packages/autosub/__init__.py", line 169, in main
    styles_list=styles_list)
  File "/usr/local/lib/python3.7/dist-packages/autosub/cmdline_utils.py", line 1619, in audio_or_video_prcs
    delete_chars=args.trans_delete_chars)
  File "/usr/local/lib/python3.7/dist-packages/autosub/core.py", line 772, in list_to_googletrans
    result_src = translator.detect(content_to_trans).lang
  File "/usr/local/lib/python3.7/dist-packages/googletrans/client.py", line 369, in detect
    translated = self.translate(text, src='auto', dest='en')
  File "/usr/local/lib/python3.7/dist-packages/googletrans/client.py", line 219, in translate
    parsed = json.loads(data[0][2])
  File "/usr/lib/python3.7/json/__init__.py", line 341, in loads
    raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not NoneType

Is this due to python being 3.7 instead of 3.6?

dropitlikecross avatar May 10 '21 18:05 dropitlikecross

Could be.

Can you try running it again? I just tested and it works. https://colab.research.google.com/github/ChanJianHao/SubMe/blob/master/SubMe.ipynb

ChanJianHao avatar Jun 18 '21 07:06 ChanJianHao

It still happens. What base format are you using?

dropitlikecross avatar Aug 26 '21 16:08 dropitlikecross

Could be.

Can you try running it again? I just tested and it works. https://colab.research.google.com/github/ChanJianHao/SubMe/blob/master/SubMe.ipynb

I`m getting the same problem 👍

Traceback (most recent call last): File "/usr/local/bin/autosub", line 8, in sys.exit(main()) File "/usr/local/lib/python3.8/dist-packages/autosub/init.py", line 166, in main cmdline_utils.audio_or_video_prcs(args, File "/usr/local/lib/python3.8/dist-packages/autosub/cmdline_utils.py", line 1614, in audio_or_video_prcs translated_text, args.src_language = core.list_to_googletrans( File "/usr/local/lib/python3.8/dist-packages/autosub/core.py", line 772, in list_to_googletrans result_src = translator.detect(content_to_trans).lang File "/usr/local/lib/python3.8/dist-packages/googletrans/client.py", line 369, in detect translated = self.translate(text, src='auto', dest='en') File "/usr/local/lib/python3.8/dist-packages/googletrans/client.py", line 219, in translate parsed = json.loads(data[0][2]) File "/usr/lib/python3.8/json/init.py", line 341, in loads raise TypeError(f'the JSON object must be str, bytes or bytearray, ' TypeError: the JSON object must be str, bytes or bytearray, not NoneType

az1fr3 avatar Dec 26 '22 19:12 az1fr3