trakt-scrobbler icon indicating copy to clipboard operation
trakt-scrobbler copied to clipboard

[Request] Internet stream media information extraction error

Open JinxAgain opened this issue 9 months ago • 8 comments

Describe the bug Internet stream media information extraction error https://*****:9443/vip/p4/2025/3/3/16/67c5ddc76bde00.02647420.mkv?KEY1=w_ovCX0sVYLhBigVCDOKTg&KEY2=1742981269&KEY3=488941&KEY4=world&KEY5=the.white.lotus.s03e03.1080p.web.h264-successfulcrab%5BEZTVx.to%5D.mkv&KEY7=febbox_file_download_v2&KEY8=488941

https://*****:9443/vip/p4/2025/3/24/10/67e138dcd038a1.50927552.mkv?KEY1=N9ARnzPtMFctM-bTL9LSCg&KEY2=1742979596&KEY3=488941&KEY4=world&KEY5=The+Hot+Spot+S01E02+Episode.2.1080p.NF.WEB-DL.JPN.AAC2.0.H.264-ToonsHub.mkv&KEY7=febbox_file_download_v2&KEY8=488941

I already added include_regexes include_regexes: episode: ['.*KEY5=(?P

.+?)[+.]+<span>sS</span><span>eE</span>', '.*KEY5=(?P<title>[\w.]+?).<span>sS</span><span>eE</span>'] movie: ['.<em>KEY5=(?!.</em>[sS]\d+[eE]\d+)(?P<title>.+?)<span>.+</span>'] <p>However, the extraction still results in "the.white.lotus" or "The+Hot+Spot". The season and episode are correct, but the title includes the dot or plus sign, which causes Trakt to fail the search.</p> <p>Is there any better way to do this? thanks in advance</p> <p><strong>Desktop (please complete the following information):</strong></p> <ul> <li>OS and Version: Windows 11 24h2</li> <li>Python Version: Python 3.10.11</li> <li>Player and Version: mpv.net v7.1.1.0</li> <li>Trakt Scrobbler Version: Trakts version 1.7.0</li> </ul> <p><strong>To Reproduce</strong></p> <p><strong>Log file</strong></p> <!-- WARNING: The log file may contain passwords and other personally identifiable information like media file paths. If you are privacy-conscious (which you should be), only paste the relevant parts, and take care to redact out the personal info. In case that info is required for fixing the issue, we can later discuss how to get it. --> <details><summary>Click to see log contents</summary> <!--DO NOT REMOVE THIS LINE--> <p> </p><pre><code class="language-<!--DO">2025-03-26 13:28:00,863 - DEBUG - mpv - file_info - Guessit url '/vip/p4/2025/3/3/16/67c5ddc76bde00.02647420.mkv' 2025-03-26 13:28:00,863 - DEBUG - mpv - file_info - Matched regex pattern re.compile('.*KEY5=(?P<title>.+?)[\\+\\.]+[sS](?P<season>\\d+)[eE](?P<episode>\\d+)') 2025-03-26 13:28:00,863 - DEBUG - mpv - file_info - Guess: {'title': 'the.white.lotus', 'season': '03', 'episode': '03', 'type': 'episode'} 2025-03-26 13:28:00,863 - DEBUG - mpv - monitor - action=stop_previous 2025-03-26 13:28:00,864 - DEBUG - mpv - monitor - action=scrobble 2025-03-26 13:28:00,864 - DEBUG - scrobbler - scrobbler - Scrobbling stop at 0.47% for The+Hot+Spot 2025-03-26 13:28:00,864 - DEBUG - mpv - monitor - {'state': 1, 'progress': 0.0, 'media_info': {'type': 'episode', 'title': 'the.white.lotus', 'season': 3, 'episode': 3}, 'updated_at': 1742966880.8630922} 2025-03-26 13:28:00,864 - WARNING - scrobbler - trakt_interface - Invalid trakt id for The+Hot+Spot 2025-03-26 13:28:00,865 - WARNING - scrobbler - scrobbler - Scrobble unsuccessful. Discarding it. 2025-03-26 13:28:00,865 - DEBUG - scrobbler - scrobbler - Scrobbling pause at 0.00% for the.white.lotus 2025-03-26 13:28:00,865 - DEBUG - scrobbler - trakt_interface - Searching trakt: Title: "the.white.lotus" 2025-03-26 13:28:01,817 - WARNING - scrobbler - trakt_interface - Trakt search yielded no results for the show, the.white.lotus 2025-03-26 13:28:01,823 - DEBUG - scrobbler - trakt_interface - Trakt ID: -1 2025-03-26 13:28:01,825 - WARNING - scrobbler - trakt_interface - Invalid trakt id for the.white.lotus 2025-03-26 13:28:01,825 - WARNING - scrobbler - scrobbler - Scrobble unsuccessful. Discarding it. 2025-03-26 13:29:16,782 - DEBUG - mpv - monitor - action=scrobble 2025-03-26 13:29:16,783 - DEBUG - mpv - monitor - {'state': 0, 'progress': 0.0, 'media_info': {'type': 'episode', 'title': 'the.white.lotus', 'season': 3, 'episode': 3}, 'updated_at': 1742966956.782815} 2025-03-26 13:29:16,783 - DEBUG - scrobbler - scrobbler - Scrobbling stop at 0.00% for the.white.lotus 2025-03-26 13:29:16,784 - WARNING - scrobbler - trakt_interface - Invalid trakt id for the.white.lotus 2025-03-26 13:29:16,784 - WARNING - scrobbler - scrobbler - Scrobble unsuccessful. Discarding it. </code></pre> </details>

JinxAgain avatar Mar 26 '25 06:03 JinxAgain

This is the perfect usecase for remap rules. See the second example usecase in the wiki docs: https://github.com/iamkroot/trakt-scrobbler/wiki/Metadata-Remap#sample-usecases Note that you'll need a separate rule for each individual show/movie.

iamkroot avatar Mar 26 '25 15:03 iamkroot

Here is the thing though, I know about remap, but do I really need to specify every single one of movie/tv I watched? I watch a lot from this kind of internet stream, I mean a lot a lot. Is there any easy way to just replace . or + to just space?

JinxAgain avatar Mar 26 '25 16:03 JinxAgain

Ok, I have pushed a feature that should be able to handle this case.

Install from branch:

  1. Stop the scrobbler with trakts stop
  2. Run pipx install --force --pip-args='--force-reinstall' git+https://github.com/iamkroot/trakt-scrobbler.git@regex-raw-path
  3. Start scrobbler with trakts start

To use it, remove the regexes from episode and movie categories, and create a new one raw_path (also a list of regexes). Create a new regex that captures the entirety of KEY5 value into a path named regex group. This value will be parsed like normal file paths, and info will automatically extracted.

This approach should be more robust than trying to detect . or + inside the paths.

iamkroot avatar Mar 26 '25 17:03 iamkroot

Hmm, I guess this will break because of +-escaped URLs, guessit isn't able to handle your second example: The+Hot+Spot+S01E02+Episode.2.1080p.NF.WEB-DL.JPN.AAC2.0.H.264-ToonsHub.mkv. Will need to run a urldecode for this... needs a bit of thinking.

iamkroot avatar Mar 26 '25 18:03 iamkroot

another todo- need to check why your original log file shows that guessit_url doesn't have the query parameters.

iamkroot avatar Mar 26 '25 18:03 iamkroot

Unfortunately, this is all the time I have right now for this. Will try to get back to it soon (a few weeks probably.) I suggest using metadata remap till then.

iamkroot avatar Mar 26 '25 18:03 iamkroot

another option might be to modify guessit config to make it handle the The+Hot+Spot case properly: https://guessit-io.github.io/guessit/configuration/, https://github.com/guessit-io/guessit/blob/master/guessit/config/options.json

(Google around to see if anyone has tried this before)

iamkroot avatar Mar 26 '25 18:03 iamkroot

Ok, I have pushed a feature that should be able to handle this case.

Install from branch:

1. Stop the scrobbler with `trakts stop`

2. Run `pipx install --force --pip-args='--force-reinstall' git+https://github.com/iamkroot/trakt-scrobbler.git@regex-raw-path`

3. Start scrobbler with `trakts start`

To use it, remove the regexes from episode and movie categories, and create a new one raw_path (also a list of regexes). Create a new regex that captures the entirety of KEY5 value into a path named regex group. This value will be parsed like normal file paths, and info will automatically extracted.

This approach should be more robust than trying to detect . or + inside the paths.

Thank you so much! This should be enough for now. I do checked guessit config, but the best I can do is still to specify The Hot Spot, so there is no point doing that. Using this brunch gives me a new bug though. Error setting up notifier! type object 'IPropertyValue' has no attribute 'get_boolean_array'

JinxAgain avatar Mar 27 '25 04:03 JinxAgain