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

Crunchyroll.com addition? #205

Closed
crider354 opened this issue Apr 25, 2020 · 5 comments
Closed

Crunchyroll.com addition? #205

crider354 opened this issue Apr 25, 2020 · 5 comments
Assignees
Labels
Audio Enhancement New feature or request Feedback Feedback is requested
Milestone

Comments

@crider354
Copy link

Instructions: This template is written in Markdown. Click the "Preview" tab to see what it will look like when submitted. Fill in the applicable sections (you can erase the examples if you'd like). For more information, please see this page.

🎥 The Site

Crunchyroll.com

💬 Subtitle Element/Node

Example:

<div class="subtitle-container">
  <p class="subtitle-text">Subtitle text</p>
</div>

📝 Additional notes

I don't know code but I was hoping you could help me figure out how to get the english subtitles to filter. Thank you!

@crider354 crider354 added the Enhancement New feature or request label Apr 25, 2020
@richardfrost richardfrost changed the title Crunchroll.com addition? Crunchyroll.com addition? Apr 25, 2020
@richardfrost
Copy link
Collaborator

I took a few minutes to see how they do their subtitles, and its actually very similar to the way that vrv.co does theirs. Its been requested a few times, but will be quite an undertaking. I haven't had the time to devote to it, but maybe I'll be able to attempt it in the future.

Basically, when playing the video, a request for the subtitle data is made, and then it converts those subtitles to an HTML canvas (essentially an image). Because of that, it isn't possible for the filter to work as it normally does (by scanning text). To make it work, the filter will probably need to make a duplicate request for the subtitle information, and filter with that.

This will probably have to be put on the back burner for a while, but hopefully I'll find some time to try and tackle it.

@crider354
Copy link
Author

Thank you for your efforts and product!

@richardfrost
Copy link
Collaborator

richardfrost commented Oct 19, 2020

I'm excited to announce some experimental support for filtering/muting on crunchyroll.com! To use it, you'll need to be on version 2.11.0+. If you get a chance to try it out, I'd love to hear feedback on your experience. If you come across a video that doesn't work, please let me know here and I will try to investigate it. If you have a good experience, please let me know too!

For this to work, you'll need to enable the "Audio muting" feature (Options > Audio Tab: "Mute audio on supported video sites").

Tips and Tricks:

These are pretty technical, so if you think you need help with one, let me know and I can help you for your particular situation.

Filter of words that contain the "S" word

In Japanese, the English "S" word is found in several words that probably don't need to be filtered. By default, the "S" word is set to the Partial match method, but you may want to set it to Exact.
Note: Once you switch it to partial, you may find a few variants on the "S" word that are no longer filtered. Feel free to add those variants with the Exact method as well to catch them in the future.

Muting

Because this ties into the audio filter function, whenever a filtered word is present the audio will be muted. If you just want the text to be filtered, follow these steps:

  1. Copy the config for the desired site: (Options > Audio: "View Supported Sites") and copy it into the Custom Audio Sites box (you'll need to close the "Supported Audio Sites" window first)
  2. Add the following line right after "mode": "cue": "muteMethod": 2
  3. Click the save button, and then reload the desired page for the changes to take effect
Example:
{
  "www.crunchyroll.com": [
    {
      "displaySelector": "canvas#velocity-canvas",
      "externalSub": true,
      "externalSubVar": "window.v1config.media.subtitles",
      "iframe": true,
      "mode": "cue",
      "muteMethod": 2,
      "showSubtitles": 0,
      "videoCueLanguage": "enUS",
      "videoCueRequireShowing": false
    }
  ]
}

Language

Currently all the testing I did was around the English language for the captions/subtitles. If you want a different language, you'll need to follow a simliar process as the Muting section above, but instead of "muteMethod": 2, you'll use "videoCueLanguage": "en-US" (replacing "en-US" with an appropriate language name).

@richardfrost richardfrost added Audio Feedback Feedback is requested labels Oct 19, 2020
@richardfrost richardfrost self-assigned this Oct 19, 2020
@crider354
Copy link
Author

crider354 commented Oct 20, 2020 via email

@richardfrost
Copy link
Collaborator

I'm going to go ahead and close this since I haven't heard anything back yet. As always, feel free to comment here, or re-open if you run into trouble.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Audio Enhancement New feature or request Feedback Feedback is requested
Projects
None yet
Development

No branches or pull requests

2 participants