Skip to content

fix: missing subtitles when a subtitle label contains ] - #1912

Merged
port19x merged 2 commits into
pystardust:masterfrom
U-L-M-S:fix-subtitle-label-brackets
Sep 16, 2026
Merged

port19x merged 2 commits into
pystardust:masterfrom
U-L-M-S:fix-subtitle-label-brackets

Conversation

@U-L-M-S

@U-L-M-S U-L-M-S commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Type of change

  • Bug fix

Description

Fixes #1910.

The subtitle list was cut at the first ]. Labels like [ToonsHub] contain one, so the English track behind it was lost and no .vtt was downloaded. The list is now cut at }], where it really ends.

Tested: all 12 episodes of the reported anime get their subtitle, master misses episodes 3 and 7.

Checklist

  • any anime playing
  • bumped version

  • next, prev, replay and select work
  • -c history and continue work
  • -d downloads work
  • -e (select episode) aka -r (range selection) works
  • -S select index works
  • -q quality works
  • -s syncplay works (not installed)
  • -v vlc works (not installed)
  • --dub and regular (sub) mode both work
  • --nextep-countdown countdown to next ep works

  • -h help info is up to date
  • Readme is up to date
  • Man page is up to date

The subtitle list was cut at the first ], so a label like [ToonsHub] hid the English track for some episodes.
@meow-hecker

Copy link
Copy Markdown

Device Info:
image

Current Ani-Cli

  1. Ani-Cli version
image
  1. Files after Downloading the specified anime from .vtt file problem #1910
image (Episode 3, 7 missing subtitles)

After applying Patch of @U-L-M-S

image
image

(Fix worked, All subtitles are present)

@U-L-M-S

U-L-M-S commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

Device Info: image

Current Ani-Cli

1. Ani-Cli version
image
2. Files after Downloading the specified anime from [.vtt file problem #1910](https://github.com/pystardust/ani-cli/issues/1910)

image (Episode 3, 7 missing subtitles)

After applying Patch of @U-L-M-S

image image

(Fix worked, All subtitles are present)

Thanks. let's see what the moderators have to say about it :)

@71zenith

Copy link
Copy Markdown
Collaborator

grep -m 1 is not POSIX compliant. Use head on the grep.

@71zenith

Copy link
Copy Markdown
Collaborator

Also you don't need to explain every line using a comment.

@meow-hecker

Copy link
Copy Markdown

Btw idk if it would be possible for you; you could add this after line no. 526:
-a | --all-download) player_function=download ep_no="1 -1" ;;
Cuz since -e "1 -1" selects everything, and -d function calls player_function=download and -e refers ep_no, -a does both so u just type -a and select an anime, everything gets downloaded.
Also after line 57 u could add smth for the -a flag, so it gets displayed in help. Just suggesting.

@U-L-M-S

U-L-M-S commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

Btw idk if it would be possible for you; you could add this after line no. 526: -a | --all-download) player_function=download ep_no="1 -1" ;; Cuz since -e "1 -1" selects everything, and -d function calls player_function=download and -e refers ep_no, -a does both so u just type -a and select an anime, everything gets downloaded. Also after line 57 u could add smth for the -a flag, so it gets displayed in help. Just suggesting.

I'm not sure if I undertood what you mean here. Do you mind giving me a Suggested Change pls ?

on the top just click on "Files changed", then select the line by pressing "+" on it and add your suggestion as code. So we can all undertand it better 😄

If you also add WHY on it, I can undertand it much better

@meow-hecker

meow-hecker commented Sep 15, 2026

Copy link
Copy Markdown

Btw idk if it would be possible for you; you could add this after line no. 526: -a | --all-download) player_function=download ep_no="1 -1" ;; Cuz since -e "1 -1" selects everything, and -d function calls player_function=download and -e refers ep_no, -a does both so u just type -a and select an anime, everything gets downloaded. Also after line 57 u could add smth for the -a flag, so it gets displayed in help. Just suggesting.

I'm not sure if I undertood what you mean here. Do you mind giving me a Suggested Change pls ?

on the top just click on "Files changed", then select the line by pressing "+" on it and add your suggestion as code. So we can all undertand it better 😄

If you also add WHY on it, I can undertand it much better

Oh sorry. I meant, the change I just suggested, it adds a "-a" flag to the ani-cli command. so when you execute it, it downloads all the episodes of the anime you selected. on #1903 , someone suggested it to be added and the moderator said to use -e "1 -1", so i thought it would be good to add a -a/--all-download flag, that calls the -d flag and -e "1 -1". You can test it, I've already tested it in the machine. Line no. 526 is where -d flag code ends, and Line-57 is where the -d flag info is. I'll do as you said on the add suggestion.

Comment thread ani-cli
-c, --continue
Continue watching from history
-d, --download
Download the video instead of playing it

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Download the video instead of playing it
-a, --all-download
Download all available episodes

Comment thread ani-cli
@U-L-M-S

U-L-M-S commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

Btw idk if it would be possible for you; you could add this after line no. 526: -a | --all-download) player_function=download ep_no="1 -1" ;; Cuz since -e "1 -1" selects everything, and -d function calls player_function=download and -e refers ep_no, -a does both so u just type -a and select an anime, everything gets downloaded. Also after line 57 u could add smth for the -a flag, so it gets displayed in help. Just suggesting.

I'm not sure if I undertood what you mean here. Do you mind giving me a Suggested Change pls ?
on the top just click on "Files changed", then select the line by pressing "+" on it and add your suggestion as code. So we can all undertand it better 😄
If you also add WHY on it, I can undertand it much better

Oh sorry. I meant, the change I just suggested, it adds a "-a" flag to the ani-cli command. so when you execute it, it downloads all the episodes of the anime you selected. on #1903 , someone suggested it to be added and the moderator said to use -e "1 -1", so i thought it would be good to add a -a/--all-download flag, that calls the -d flag and -e "1 -1". You can test it, I've already tested it in the machine. Line no. 526 is where -d flag code ends, and Line-57 is where the -d flag info is. I'll do as you said on the add suggestion.

ahh okay.. I got it !!! nice idea.
but this is not something I would add here but in a new PR.
sincerelly.. I don't think the moderators would want it, I have the feeling that the ani-cli project was created to bee simple adn the user can use it so simple as possible and add ani-cli in their scripts. got it ? ;D

but try it it anyway pls. Open a new Issue, add the tag as "feature request" and the create a PR explaning how and why :D

@meow-hecker

Copy link
Copy Markdown

Btw idk if it would be possible for you; you could add this after line no. 526: -a | --all-download) player_function=download ep_no="1 -1" ;; Cuz since -e "1 -1" selects everything, and -d function calls player_function=download and -e refers ep_no, -a does both so u just type -a and select an anime, everything gets downloaded. Also after line 57 u could add smth for the -a flag, so it gets displayed in help. Just suggesting.

I'm not sure if I undertood what you mean here. Do you mind giving me a Suggested Change pls ?
on the top just click on "Files changed", then select the line by pressing "+" on it and add your suggestion as code. So we can all undertand it better 😄
If you also add WHY on it, I can undertand it much better

Oh sorry. I meant, the change I just suggested, it adds a "-a" flag to the ani-cli command. so when you execute it, it downloads all the episodes of the anime you selected. on #1903 , someone suggested it to be added and the moderator said to use -e "1 -1", so i thought it would be good to add a -a/--all-download flag, that calls the -d flag and -e "1 -1". You can test it, I've already tested it in the machine. Line no. 526 is where -d flag code ends, and Line-57 is where the -d flag info is. I'll do as you said on the add suggestion.

ahh okay.. I got it !!! nice idea. but this is not something I would add here but in a new PR. sincerely.. I don't think the moderators would want it, I have the feeling that the ani-cli project was created to be simple and the user can use it so simple as possible and add ani-cli in their scripts. got it ? ;D

but try it it anyway pls. Open a new Issue, add the tag as "feature request" and then create a PR explaning how and why :D

well i guess, but every time you use ani-cli -U your script will get updated and your changed will be removed, and also it's just a 4 line addition that's why I didn't want to do a pull request and instead suggested it to you. I mean, you could just add it in your commit if it allows. Sorry, I'm kinda new to Github and don't really know everything here. Would it be possible for you to add it in your own commit??

@port19x

port19x commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

I have rejected your feature request previously, Meowhecker. Please abstain from the "-a" flag.

Comment thread ani-cli Outdated
@port19x

port19x commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator
Screenshot 2026-09-16 at 19 08 30 regarding grep -m

@port19x

port19x commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator
Screenshot 2026-09-16 at 19 15 56 plus this slop, we could probably use a refactor PR sometime

@port19x

port19x commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

I was able to reproduce the issue and the fact that this pull request does indeed solve it.

@port19x
port19x merged commit 96f9140 into pystardust:master Sep 16, 2026
8 checks passed
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

Successfully merging this pull request may close these issues.

.vtt file problem

4 participants