mkbloke · GitHub

@mkbloke

Copy link Copy Markdown

Member

closes #4559

Live:

$ streamlink https://www.aloula.sa/en/live/sbc-channel
[cli][info] Found matching plugin aloula for URL https://www.aloula.sa/en/live/sbc-channel
Available streams: 360p (worst), 480p, 1080p (best)

VOD:

$ streamlink https://www.aloula.sa/episode/11178?continue=8
[cli][info] Found matching plugin aloula for URL https://www.aloula.sa/episode/11178?continue=8
Available streams: 240p (worst), 360p, 480p, 720p, 1080p (best)

Login restricted VOD:

$ streamlink https://www.aloula.sa/episode/11577
[cli][info] Found matching plugin aloula for URL https://www.aloula.sa/episode/11577
[plugins.aloula][error] This stream requires a logged-in session cookie to be supplied
error: No playable streams found on this URL: https://www.aloula.sa/episode/11577

Here is something strange that I can't work out - the author and title appear swapped (please tell me I'm not going crazy...):

$ streamlink -l trace --title '{id} ! {author} ! {title} ! {category}' https://www.aloula.sa/episode/11178?continue=8 240p
[22:26:25.895440][cli][debug] OS:         Linux-5.4.0-110-generic-x86_64-with-glibc2.29
[22:26:25.895729][cli][debug] Python:     3.8.10
[22:26:25.895826][cli][debug] Streamlink: 4.1.0+2.g7cb0ebe9
[22:26:25.895929][cli][debug] Requests(2.27.1), Socks(1.7.1), Websocket(1.3.2)
[22:26:25.896350][cli][debug] Arguments:
[22:26:25.896438][cli][debug]  url=https://www.aloula.sa/episode/11178?continue=8
[22:26:25.896545][cli][debug]  stream=['240p']
[22:26:25.896669][cli][debug]  --loglevel=trace
[22:26:25.896807][cli][debug]  --player=mpv
[22:26:25.896949][cli][debug]  --title={id} ! {author} ! {title} ! {category}
[22:26:25.897834][cli][info] Found matching plugin aloula for URL https://www.aloula.sa/episode/11178?continue=8
[22:26:26.688017][plugins.aloula][trace] {'id': '11178', 'program_title': 'استشارات المشاهير', 'title': 'الحلقة 30', 'season_number': 1, 'episode': 30}
[22:26:27.066280][utils.l10n][debug] Language code: en_GB
[22:26:28.566585][cli][info] Available streams: 240p (worst), 360p, 480p, 720p, 1080p (best)
[22:26:28.566883][cli][info] Opening stream: 240p (hls)
[22:26:28.567071][cli][info] Starting player: mpv
[22:26:28.568659][stream.hls][debug] Reloading playlist
[22:26:28.570707][cli][debug] Pre-buffering 8192 bytes
[22:26:28.859066][stream.hls][debug] First Sequence: 1; Last Sequence: 231
[22:26:28.859241][stream.hls][debug] Start offset: 0; Duration: None; Start Sequence: 1; End Sequence: 231
[22:26:28.859339][stream.hls][debug] Adding segment 1 to queue
[22:26:29.593536][stream.hls][debug] Segment 1 complete
[22:26:29.594209][cli.output][debug] Opening subprocess: mpv "--force-media-title=11178 ! استشارات المشاهير ! الحلقة 30 ! S1E30" -
[22:26:35.863422][cli][info] Player closed
[22:26:35.863623][stream.segmented][debug] Closing worker thread
[22:26:35.863931][stream.hls][debug] Adding segment 33 to queue
[22:26:35.864090][stream.segmented][debug] Closing writer thread
[22:26:36.169204][stream.hls][debug] Segment 12 complete
[22:26:36.865930][cli][info] Stream ended
[22:26:36.866516][cli][info] Closing currently open stream...

@mkbloke

bastimeyer

Copy link Copy Markdown

Member

Choose a reason for hiding this comment

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

Looking good, thanks!

@bastimeyer

Copy link Copy Markdown

Member

the author and title appear swapped

RTL text?

@mkbloke

Copy link Copy Markdown

Member Author

RTL text?

Does that make sense to you then? I considered that the text is an RTL language, I didn't think it would affect the token order?

@bastimeyer

Copy link Copy Markdown

Member

It's not about the token order. It's about the start and end of RTL text and the characters in between the {author} and {title} variables in your --title argument value.

Konsole for example, my terminal emulator, shows the correct/expected order, but when I copy and paste it into Chromium, it's displayed wrong. And MPV does display it incorrectly as well. That's be cause it's detecting RTL characters without RTL marks, and it fills in those marks and changes the order until the first non-RTL character has been found. Non-alphanumeric characters like ! get ignored. If you replace the ! character with a latin character, you'll see that only the variable substitutions themselves get displayed as RTL text.

$ streamlink 'https://www.aloula.sa/episode/11178?continue=8' best -j \
        | jq -r '"! \(.metadata.author) ! \(.metadata.title) !"'
! استشارات المشاهير ! الحلقة 30 !
$ streamlink 'https://www.aloula.sa/episode/11178?continue=8' best -j \
  | jq -r '"foo \(.metadata.author) bar \(.metadata.title) baz"'
foo استشارات المشاهير bar الحلقة 30 baz

@back-to

@mkbloke

@mkbloke

Read the original on github.com ↗