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

unexpected token in media title cause syntax error #226

Open
CheesyChocolate opened this issue Sep 4, 2024 · 5 comments
Open

unexpected token in media title cause syntax error #226

CheesyChocolate opened this issue Sep 4, 2024 · 5 comments

Comments

@CheesyChocolate
Copy link

CheesyChocolate commented Sep 4, 2024

Describe the bug

If the title contains character that can be interpreted by bash, It can break the script. characters like (, ), ' and etc.

I suggest cleaning the strings before passing them. some sed or tr magic can be used here.

as an example the following is the output error of script.

Now Playing - Grey's Anatomy
/usr/bin/lobster: eval: line 580: syntax error near unexpected token `('
/usr/bin/lobster: eval: line 580: `mpv --sub-file='https://cc.2cdns.com/51/fb/51fbadefae13fd78992253baa2b47922/eng-6.vtt' --force-media-title='Grey's Anatomy - Season 11 - Eps 23: She's Leaving Home (Part 2 of 2)' 'https://b-g-eu-13.raffaellocdn.net:2223/v3-hls-playback/979b78c0942d15c5ea4b8125adf1314d1becab4d1d74a82ca3187966c4b2a8b5e1b4b357700904dc3dabdf61592fa2e3a6f7a7253692a4fa9c86eeefdf37ee87d0e80b89f6053074cf70a65dc41f3e26ce4f1e81283eabb290688d3b6b0f77acfab76c6f362150d842fbc73d9e6113180f606330252dfdadb7859f1db5dad872e5f84c3a9564139951f73b2bbc770684eda276c0f4e88bc555b70562c2f4dd76a69669ceef03d13d15b69d8a5ded37bf/playlist.m3u8' --watch-later-dir='/tmp/lobster/watchlater' --write-filename-in-watch-later-config --save-position-on-quit --quiet'

if i just remove the problematic characters from title, It will work without problem.

mpv --sub-file='https://cc.2cdns.com/51/fb/51fbadefae13fd78992253baa2b47922/eng-6.vtt' --force-media-title='Grey's Anatomy - Season 11 - Eps 23: Shes Leaving Home Part 2 of 2' 'https://b-g-eu-13.raffaellocdn.net:2223/v3-hls-playback/979b78c0942d15c5ea4b8125adf1314d1becab4d1d74a82ca3187966c4b2a8b5e1b4b357700904dc3dabdf61592fa2e3a6f7a7253692a4fa9c86eeefdf37ee87d0e80b89f6053074cf70a65dc41f3e26ce4f1e81283eabb290688d3b6b0f77acfab76c6f362150d842fbc73d9e6113180f606330252dfdadb7859f1db5dad872e5f84c3a9564139951f73b2bbc770684eda276c0f4e88bc555b70562c2f4dd76a69669ceef03d13d15b69d8a5ded37bf/playlist.m3u8' --watch-later-dir='/tmp/lobster/watchlater' --write-filename-in-watch-later-config --save-position-on-quit --quiet

To Reproduce
Steps to reproduce the behavior:

Watch Gray's Anatomy Season 11 Eps 23 with help of lobster search.

Desktop (please complete the following information):

  • OS: Linux
  • Version: Linux 6.10.6-arch1-1.1-g14 Thu, 29 Aug 2024 07:08:56 +0000 x86_64 GNU/Linux
  • Lobster Version: 4.3.2 (git Version: r215.d8a2b73-1)
@justchokingaround
Copy link
Owner

right, didn't realize that would happen. in the meantime a fix would be to install hxunent (html-xml-utils is the package name iirc)

@CheesyChocolate
Copy link
Author

I already have the said package installed, maybe the script does not use the package properly.

cachyos-extra-v3/html-xml-utils 8.6-2.1 (261.3 KiB 2.7 MiB) (Installed)
    Utilities for manipulating HTML and XML files

@justchokingaround
Copy link
Owner

and u have the hxunent binary?

@CheesyChocolate
Copy link
Author

yes I do.

$ command -v hxunent
/usr/bin/hxunent

$ hxunent -v
hxunent: invalid option -- 'v'
Version 8.6

@justchokingaround
Copy link
Owner

that's not good. I'll look into it when I have some time

medanisjbara pushed a commit to medanisjbara/lobster that referenced this issue Sep 20, 2024
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