specs of showroom-live.com HLS m3u8 URL
showroom-live URL
https://www.showroom-live.com/<ROOM_URL_KEY>
<ROOM_URL_KEY>
: this is inside name, about room-id/name
http://NNN.NNN.NNN.NNN:NNNN/liveedge/<64_DIGIT_HASH>/playlist.m3u8
A : ~=48 - 96+kbps mono 44.1kHz 1ch AAC LC v4
V : ~=100 - 1000+kbps AVC Baseline@L3 640x360p
AV: MPEG-TS mp4
these codes under the those license
// @author noromanba http://noromanba.flavors.me
// @license MIT license https://nrm.mit-license.org/2016
(() => {
'use strict';
// TBD error check, guard block
//*/
// from <script> in <head> or more
const url = JSON.parse(document.querySelector([
'#js-initial-data'
]).dataset.json).streamingUrlHls;
/*/
// from global object; probably `DOMContentLoaded` or later
const url = SrGlobal.livedata.streaming_url_hls;
//*/
// optional
const title = document.title;
return `${title}
${url}`;
})();
javascript:(()=>{'https://gist.github.com/noromanba/34b7ba05dbccb4fa844c18a88ff38d89#bookmarklet';const url=JSON.parse(document.querySelector(['#js-initial-data']).dataset.json).streamingUrlHls;const title=document.title;window.prompt(title,url);})();
min basecode
// @author noromanba http://noromanba.flavors.me
// @license MIT license https://nrm.mit-license.org/2016
(() => {
const url = JSON.parse(document.querySelector([
'#js-initial-data'
]).dataset.json).streamingUrlHls;
const title = document.title;
window.prompt(title, url);
})();
can use static HTML, require http GET
only; so fast!
but hardcore oneliner training
SrGlobal.livedata
JSON syntax;
"streaming_url_hls":"http:\/\/NNN.NNN.NNN.NNN:NNNN\/liveedge\/<64_DIGIT_HASH>\/playlist.m3u8"
\
escaped, so
GET https://www.showroom-live.com/<ROOM_URL_KEY> | grep -o -P '"streaming_url_hls"\s*:\s*"\K[^"]+' | tr -d '\\' | head -1
# wrapped ver
GET https://www.showroom-live.com/<ROOM_URL_KEY> | \
grep -o -P '"streaming_url_hls"\s*:\s*"\K[^"]+' | \
tr -d '\\' | head -1
if needed;
GET https://www.showroom-live.com/<ROOM_URL_KEY> | grep -o -P '<title>\K.+(?=</title>)'
# wrapped ver
GET https://www.showroom-live.com/<ROOM_URL_KEY> | \
grep -o -P '<title>\K.+(?=</title>)'
or
GET https://www.showroom-live.com/<ROOM_URL_KEY> | grep -o -P '(?<=<title>).+(?=</title>)'
# wrapped ver
GET https://www.showroom-live.com/<ROOM_URL_KEY> | \
grep -o -P '(?<=<title>).+(?=</title>)'
difference between 2-methods, ignore-left RegExp pattern only;
\K
or (?<=)
e.g. vlc/mpv
mpv $(GET https://www.showroom-live.com/<ROOM_URL_KEY> | grep -o -P '"streaming_url_hls"\s*:\s*"\K[^"]+' | tr -d '\\' | head -1)
# wrapped ver
mpv $(GET https://www.showroom-live.com/<ROOM_URL_KEY> | \
grep -o -P '"streaming_url_hls"\s*:\s*"\K[^"]+' | \
tr -d '\\' | head -1)
vlc $(GET https://www.showroom-live.com/<ROOM_URL_KEY> | grep -o -P '"streaming_url_hls"\s*:\s*"\K[^"]+' | tr -d '\\' | head -1)
# wrapped ver
vlc $(GET https://www.showroom-live.com/<ROOM_URL_KEY> | \
grep -o -P '"streaming_url_hls"\s*:\s*"\K[^"]+' | \
tr -d '\\' | head -1)
this UserScript depends on jQuery
, XHR
to endpoint approach
perhaps DOMContentLoaded
, load
or later