oltodosel / interSubs

Interactive subtitles for mpv. Instantly translate selected word/sentence.
MIT License
225 stars 20 forks source link

Subtitles disappear, no missing dependencies #56

Open samnj opened 8 months ago

samnj commented 8 months ago

I read all similar issues. Httpx is installed and in fact it doesn't complain about it. There are some "cannot find main" errors but I read some issues where it worked after installing httpx, main not found and all. I'm not using any other scripts, and I see no errors after the script is loaded:

> mpv The.Adventures.of.Tintin.2011.BluRay.1080p.DTS.x264-DON.mkv
Cannot find main.* for any supported scripting backend in: /home/sam/.config/mpv/scripts/urls
Cannot find main.* for any supported scripting backend in: /home/sam/.config/mpv/scripts/__pycache__
Can't load unknown script: /home/sam/.config/mpv/scripts/interSubs_config.py
Can't load unknown script: /home/sam/.config/mpv/scripts/interSubs.py
 (+) Video --vid=1 (*) (h264 1920x816 23.976fps)
 (+) Audio --aid=1 --alang=eng (*) (dts 6ch 48000Hz)
     Subs  --sid=1 --slang=eng (*) (subrip)
AO: [pipewire] 48000Hz 5.1(side) 6ch floatp
VO: [gpu] 1920x816 yuv420p
AV: 00:00:05 / 01:46:51 (0%) A-V:  0.000 Cache: 88s/150MB
Track switched:
 (+) Video --vid=1 (*) (h264 1920x816 23.976fps)
 (+) Audio --aid=1 --alang=eng (*) (dts 6ch 48000Hz)
 (+) Subs  --sid=1 --slang=eng (*) (subrip)
AV: 00:00:12 / 01:46:51 (0%) A-V:  0.000 Cache: 86s/150MB
[interSubs] Starting interSubs ... 
/home/sam/.config/mpv/scripts/interSubs.py:591: SyntaxWarning: invalid escape sequence '\d'
  p = re.sub('<div style="float:right;color:#999">\d*</div>', '', p)
/home/sam/.config/mpv/scripts/interSubs.py:592: SyntaxWarning: invalid escape sequence '\d'
  p = re.sub('<span style="color:#666;font-size:10px;padding:0 2px;position:relative;top:-3px">\d*</span>', '', p)
/home/sam/.config/mpv/scripts/interSubs.py:595: SyntaxWarning: invalid escape sequence '\d'
  trs = soup.find_all('tr', id = re.compile('tr\d*'))
/home/sam/.config/mpv/scripts/interSubs.py:695: SyntaxWarning: invalid escape sequence '\s'
  line0 = re.sub('\s+', ' ', res0.repr.getText())
/home/sam/.config/mpv/scripts/interSubs.py:696: SyntaxWarning: invalid escape sequence '\s'
  line1 = re.sub('\s+', ' ', res1.repr.getText())
/home/sam/.config/mpv/scripts/interSubs.py:749: SyntaxWarning: invalid escape sequence '\s'
  he = re.sub('\s+', ' ', he.get_text()).strip()
/home/sam/.config/mpv/scripts/interSubs.py:752: SyntaxWarning: invalid escape sequence '\s'
  en = re.sub('\s+', ' ', en.get_text()).strip()
/home/sam/.config/mpv/scripts/interSubs.py:840: SyntaxWarning: invalid escape sequence '\('
  tr = re.findall('Play\((.*?)\)', tr)[0]
/home/sam/.config/mpv/scripts/interSubs.py:907: SyntaxWarning: invalid escape sequence '\d'
  result = re.search("\d{6}\.[0-9]+", tkk_expr).group(0)
/home/sam/.config/mpv/scripts/interSubs.py:912: SyntaxWarning: invalid escape sequence '\d'
  a = re.search("a\\\\x3d(-?\d+);", tkk_expr).group(1)
/home/sam/.config/mpv/scripts/interSubs.py:913: SyntaxWarning: invalid escape sequence '\d'
  b = re.search("b\\\\x3d(-?\d+);", tkk_expr).group(1)
/home/sam/.config/mpv/scripts/interSubs.py:1141: SyntaxWarning: invalid escape sequence '\W'
  l2 = re.findall('(?!%)\W+$', l)[0][::-1]
/home/sam/.config/mpv/scripts/interSubs.py:1145: SyntaxWarning: invalid escape sequence '\W'
  l2 += re.sub('^\W+|(?!%)\W+$', '', l)
/home/sam/.config/mpv/scripts/interSubs.py:1148: SyntaxWarning: invalid escape sequence '\W'
  l2 += re.findall('^\W+', l)[0][::-1]
/home/sam/.config/mpv/scripts/interSubs.py:1503: SyntaxWarning: invalid escape sequence '\d'
  config.style_subs = re.sub('font-size: (\d+)px;', lambda size: [ 'font-size: %dpx;' % ( int(size.group(1)) - 1 ), mpv_message('font: %s' % size.group(1)) ][0], config.style_subs, flags = re.I)
/home/sam/.config/mpv/scripts/interSubs.py:1508: SyntaxWarning: invalid escape sequence '\d'
  config.style_subs = re.sub('font-size: (\d+)px;', lambda size: [ 'font-size: %dpx;' % ( int(size.group(1)) + 1 ), mpv_message('font: %s' % size.group(1)) ][0], config.style_subs, flags = re.I)
[py part] Starting interSubs ...
(Paused) AV: 00:00:39 / 01:46:51 (1%) A-V:  0.000 Cache: 83s/150MB

Exiting... (Quit)
[interSubs] Quitting interSubs ... 
oltodosel commented 1 month ago

By default works only in fullscreen. Give more info about your system. Try a different desktop env.