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

What is wrong? #16

Closed
Uitalo opened this issue Jan 11, 2019 · 19 comments
Closed

What is wrong? #16

Uitalo opened this issue Jan 11, 2019 · 19 comments

Comments

@Uitalo
Copy link

Uitalo commented Jan 11, 2019

When I run Intersubs the legend loads for a few seconds, but soon disappears. Python remains in execution.
MacOs Monjave 10.14.2

image
image

@oltodosel
Copy link
Owner

Legend? Do you mean subtitles?
By default subtitles hide when not in full-screen.

@Uitalo
Copy link
Author

Uitalo commented Jan 11, 2019

Sorry, subtitles in portuguese is "legendas",reason for my mistake. But not is the error:
image

@oltodosel
Copy link
Owner

I presume the issue is resolved now?

xdotools must be installed for interSubs to work properly.

@Uitalo
Copy link
Author

Uitalo commented Jan 12, 2019

Not, xdotools it's installed

@oltodosel
Copy link
Owner

Use google-translate to properly formulate the problem, because I hardly can understand you.

hide_when_not_fullscreen_B = False didn't help?

@Uitalo
Copy link
Author

Uitalo commented Jan 12, 2019

No, in my post number 3 I put a print where I showed that this option is already active from the beginning.

@Uitalo
Copy link
Author

Uitalo commented Jan 12, 2019

being clearer, I already used your script in Ubuntu, so I'm already familiar with the installation. I experienced this error when migrating to MacOS.

@oltodosel
Copy link
Owner

Did at any point subtitles from interSubs appear on the screen? Or interSubs start and nothing happens?
What did you mean by this?

When I run Intersubs the legend loads for a few seconds, but soon disappears.

@Uitalo
Copy link
Author

Uitalo commented Jan 12, 2019

"Did at any point subtitles from interSubs appear on the screen? Or interSubs start and nothing happens?"
I reinstalled everything again, so let's not consider the previous errors.

Now I have the following error:
https://www.youtube.com/watch?v=zbUHHNhjGEI&feature=youtu.be

@oltodosel
Copy link
Owner

MacOS requires some additional flags. What are the needed flags exactly I don't know.
Try changing at provided lines to something like this:
self.subtitles.setWindowFlags(Qt.X11BypassWindowManagerHint | Qt.FramelessWindowHint)
search how to fix it in MacOS https://www.google.com/search?num=50&ei=&q=macos+qt+window+without+frame

self.subtitles.setWindowFlags(Qt.X11BypassWindowManagerHint)

self.subtitles2.setWindowFlags(Qt.X11BypassWindowManagerHint)

self.popup.setWindowFlags(Qt.X11BypassWindowManagerHint)

@Uitalo
Copy link
Author

Uitalo commented Jan 12, 2019

I think I've made some progress: https://www.youtube.com/watch?v=ryNetfH6Snw&feature=youtu.be
Interview subtitles start more then die. Do you have any other suggestions?

@oltodosel
Copy link
Owner

Try commenting/deleting these lines:

interSubs/interSubs.py

Lines 1033 to 1047 in 08ffbcf

# hide subs when mpv isn't in focus or in fullscreen
if inc * config.update_time > config.focus_checking_time - 0.0001:
while 'mpv' not in subprocess.getoutput('xdotool getwindowfocus getwindowname') or (config.hide_when_not_fullscreen_B and not mpv_fullscreen_status()) or (os.path.exists(mpv_socket + '_hide')):
if not was_hidden:
self.update_subtitles.emit(True, False)
was_hidden = 1
else:
time.sleep(config.focus_checking_time)
inc = 0
inc += 1
if was_hidden:
was_hidden = 0
self.update_subtitles.emit(False, False)
continue

@Uitalo
Copy link
Author

Uitalo commented Jan 12, 2019

Now I have:
[interSubs2] Starting interSubs ...
[py part] Starting interSubs ...V: 0.000
Traceback (most recent call last): 0.000
File "/Users/cassiouitalo/.config/mpv/scripts/interSubs.py", line 1037, in main
if config.lang_from != 'he' and config.lang_from != 'iw' and any((c in set('קראטוןםפשדגכעיחלךףזסבהנמצתץ')) for c in tmp_file_subs):
NameError: name 'tmp_file_subs' is not defined

@oltodosel
Copy link
Owner

You deleted more than I've said to.

@Uitalo
Copy link
Author

Uitalo commented Jan 12, 2019

Very good !!! but is a bit slow to load the translation.
image

@oltodosel
Copy link
Owner

Maybe you've got slow internet connection. Idk.
Try changing dictionaries at config.
translation_function_names = ['dict_cc', 'pons']

@Uitalo
Copy link
Author

Uitalo commented Jan 12, 2019

Do you know this error in google dict:

Exception in thread Thread-14:28 (55%) A-V: 0.000
Traceback (most recent call last):
File "/Users/cassiouitalo/.config/mpv/scripts/interSubs.py", line 289, in google
p = open(fname).read().split('=====/////-----')
FileNotFoundError: [Errno 2] No such file or directory: 'urls/https:--translate.google.com-translate_a-single?client=t&sl=en&tl=pt&hl=pt&dt=at&dt=bd&dt=ex&dt=ld&dt=md&dt=qca&dt=rw&dt=rm&dt=ss&dt=t&ie=UTF-8&oe=UTF-8&otf=1&pc=1&ssel=3&tsel=3&kc=2&q=sort'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "/Users/cassiouitalo/.config/mpv/scripts/interSubs.py", line 300, in google
tk = acquirer.do(word)
File "/Users/cassiouitalo/.config/mpv/scripts/interSubs.py", line 278, in do
self._update()
File "/Users/cassiouitalo/.config/mpv/scripts/interSubs.py", line 160, in _update
code = str(self.RE_TKK.search(r.text).group(1)).replace('var ', '')
AttributeError: 'NoneType' object has no attribute 'group'

@oltodosel
Copy link
Owner

Google-translator doesn't work as it seems.
I've no time to debug it, do it yourself, or pick different translator.

@Uitalo
Copy link
Author

Uitalo commented Jan 12, 2019

I would like to have enough knowledge to do so. :)

Thank you so much!!!

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