Closed Ryner95 closed 1 year ago
Have you solved it yet ? i also meet the same problem.
Not yet, there is a lot that I do not control, the most I could do is download a single model by modifying the following function
def getVideoUrl(self):
return self.getWantedResolutionPlaylist("https://b-{server}.{host}/hls/{id}/master/{id}.m3u8".format(
server=self.lastInfo["cam"]["viewServers"]["flashphoner-hls"],
host='doppiocdn.com',
id=self.lastInfo["cam"]["streamName"]
))
https://b-{server}.{host}/hls/{id}/master/{id}.m3u8
to https://edge-hls.doppiocdn.com/hls/87945933/master/87945933_auto.m3u8
which is the url of the playlist of the model.
Giving me the following error but being able to record at least that broadcast
File "C:\Users\%username%\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
self.run()
File "D:\proyect z\StreaMonitor-master\streamonitor\managers\zmqmanager.py", line 13, in run
socket.bind("tcp://*:6969")
File "C:\Users\%username%\AppData\Local\Programs\Python\Python310\lib\site-packages\zmq\sugar\socket.py", line 301, in bind
super().bind(addr)
File "zmq\backend\cython\socket.pyx", line 564, in zmq.backend.cython.socket.Socket.bind
I'll try later to see if I can find something else
EDIT: I suppose that putting the following url should work, but I won't try it until I finish what I'm recording:
https://edge-hls.{host}/hls/{id}/master/{id}.m3u8
or https://edge-hls.{host}/hls/{id}/master/{id}_auto.m3u8
For a short view I think they changed to WebRTC in general.
Due to the fact that the HLS URLs get 403 responses and the browser behaviour I think they have switched or do switching to WebRTC. These happens also for non VR stuff which in past always was WebSocket based.
As @Ryner95 wrote:
This format seems to work https://edge-hls.{host}/hls/{id}/master/{id}.m3u8
Check this:
#!/usr/bin/env python3
import sys
import requests
def main(argv):
headers = {
"User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0"
}
username = sys.argv[1]
r = requests.get("https://stripchat.com/api/vr/v2/models/username/"+username, headers=headers)
data = r.json()
# server = data["cam"]["viewServers"]["flashphoner-hls"]
# host ='doppiocdn.com'
idnum = data["cam"]["streamName"]
# hls_url = "https://b-{server}.{host}/hls/{idnum}/master/{idnum}.m3u8".format(server=server, host=host, idnum=idnum)
new_url = "https://edge-hls.doppiocdn.com/hls/{idnum}/master/{idnum}.m3u8".format(idnum=idnum)
print(new_url)
if __name__ == "__main__":
main(sys.argv)
Simply run:
python script.py username
and you get back the url.
Old API call structure is included that leads to 403 Errors.
Excuse my ignorance but where is it executed?
python script.py username
It's working for me for now without error messages with this https://edge-hls.{host}/hls/{id}/master/{id}_auto.m3u8
PS D:\proyect z\StreaMonitor-master> python .\Downloader.py
> * Serving Flask app 'streamonitor.managers.httpmanager'
* Debug mode: off
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on http://127.0.0.1:5000
Press CTRL+C to quit
2023-05-25 16:18:30,218 - INFO - [SC] FiOnee: Channel online
2023-05-25 16:18:30,306 - INFO - [SC] FiOnee: Selected 1280x720 resolution
2023-05-25 16:18:30,306 - INFO - [SC] FiOnee: Started downloading show
add Mandy-Nicole sc
2023-05-25 16:19:46,645 - INFO - manager_cli: Added [SC] Mandy-Nicole
> 2023-05-25 16:19:47,856 - INFO - [SC] Mandy-Nicole: Channel online
2023-05-25 16:19:47,937 - INFO - [SC] Mandy-Nicole: Selected 1280x720 resolution
2023-05-25 16:19:47,938 - INFO - [SC] Mandy-Nicole: Started downloading show
add Tsumugi_M sc
2023-05-25 16:20:18,562 - INFO - manager_cli: Added [SC] Tsumugi_M
> 2023-05-25 16:20:20,027 - INFO - [SC] Tsumugi_M: Channel online
2023-05-25 16:20:20,114 - INFO - [SC] Tsumugi_M: Selected 1280x720 resolution
2023-05-25 16:20:20,114 - INFO - [SC] Tsumugi_M: Started downloading show
2023-05-25 16:20:30,649 - INFO - [SC] Tsumugi_M: Channel online
2023-05-25 16:20:30,729 - INFO - [SC] Tsumugi_M: Selected 1280x720 resolution
2023-05-25 16:20:30,729 - INFO - [SC] Tsumugi_M: Started downloading show
status
2023-05-25 16:22:12,416 - INFO - manager_cli: Status:
Free space: 5.781%
+--------------+------------+---------+----------------+
| Username | Site | Started | Status |
+--------------+------------+---------+----------------+
| FiOnee | StripChat | True | Channel online |
| Mandy-Nicole | StripChat | True | Channel online |
| Tsumugi_M | StripChat | True | Channel online |
+--------------+------------+---------+----------------+
That's great @Ryner95
It seems both works:
The difference seems to be that _auto replies a long variant playlist when multiple qualitys are available. Without _auto simply the best qulity is replied in a variant playlist.
I think that my earlier 403 with _auto could happen when only one quality is available - really only one - or the model status was switched in that moment.
#!/usr/bin/env python3
import sys
import requests
def main(argv):
headers = {
"User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0"
}
username = sys.argv[1]
r = requests.get("https://stripchat.com/api/vr/v2/models/username/"+username, headers=headers)
data = r.json()
# server = data["cam"]["viewServers"]["flashphoner-hls"]
# host ='doppiocdn.com'
idnum = data["cam"]["streamName"]
# hls_url = "https://b-{server}.{host}/hls/{idnum}/master/{idnum}.m3u8".format(server=server, host=host, idnum=idnum)
new_url = "https://edge-hls.doppiocdn.com/hls/{idnum}/master/{idnum}.m3u8".format(idnum=idnum)
new_url_auto = "https://edge-hls.doppiocdn.com/hls/{idnum}/master/{idnum}_auto.m3u8".format(idnum=idnum)
print(new_url)
print(new_url_auto)
if __name__ == "__main__":
main(sys.argv)
You can check by curl the URLs which are displayed and check the differences. Run like above shown.
I recommand this for stripchat.py (just a temporary fix):
def getVideoUrl(self):
return self.getWantedResolutionPlaylist("https://edge-hls.doppiocdn.com/hls/{id}/master/{id}_auto.m3u8".format(
id=self.lastInfo["cam"]["streamName"]
))
It wouldn't work for me without the auto, yes, I'll leave it temporarily until it stops working or until the project is updated
Have you solved it yet ? i also meet the same problem.
@SeeingDragon
Temporaly https://github.com/lossless1024/StreaMonitor/issues/82#issuecomment-1563025579
Yup, i get the error as well now.
same
That's great @Ryner95
It seems both works:
The difference seems to be that _auto replies a long variant playlist when multiple qualitys are available. Without _auto simply the best qulity is replied in a variant playlist.
I think that my earlier 403 with _auto could happen when only one quality is available - really only one - or the model status was switched in that moment.
#!/usr/bin/env python3 import sys import requests def main(argv): headers = { "User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0" } username = sys.argv[1] r = requests.get("https://stripchat.com/api/vr/v2/models/username/"+username, headers=headers) data = r.json() # server = data["cam"]["viewServers"]["flashphoner-hls"] # host ='doppiocdn.com' idnum = data["cam"]["streamName"] # hls_url = "https://b-{server}.{host}/hls/{idnum}/master/{idnum}.m3u8".format(server=server, host=host, idnum=idnum) new_url = "https://edge-hls.doppiocdn.com/hls/{idnum}/master/{idnum}.m3u8".format(idnum=idnum) new_url_auto = "https://edge-hls.doppiocdn.com/hls/{idnum}/master/{idnum}_auto.m3u8".format(idnum=idnum) print(new_url) print(new_url_auto) if __name__ == "__main__": main(sys.argv)
You can check by curl the URLs which are displayed and check the differences. Run like above shown.
I recommand this for stripchat.py (just a temporary fix):
def getVideoUrl(self): return self.getWantedResolutionPlaylist("https://edge-hls.doppiocdn.com/hls/{id}/master/{id}_auto.m3u8".format( id=self.lastInfo["cam"]["streamName"] ))
thank you
Just a heads up, Stripchat changed URL format again, yesterday or so:
Old: https://b-{server}.{host}/hls/{id}/master/{id}.m3u8
New: https://b-{server}.{host}/hls/{id}/{id}.m3u8
Cheers
I hope a new fix gets pushed soon, because even @aitschti 's new url format do not work.
Yes, I can confirm, this does not work here. The URL is correct though (using it in a Kodi video plugin for SC) but the parsing for resolutions of the m3u8 fails, therefore the message of missing sources. There are no links to the resolution's m3u8. At least that is what I think is going on, haven't studied the m3u8 class. And indeed there is no resolution information in the m3u8 in comparison to a m3u8 file from chaturbate for example. The working URL from me may just be a fixed resolution chunklist and we need another real URL.
API reqeust still works.
The format @aitschti posted doesn't work. It gives no playlist back.
edge-hls in the quto variant still replies with valid variant playlist.
@DerBunteBall is correct, the edge-hls URL gives the valid playlists back. Sorry, did not check the whole thread. Mine is usable in other contexts, not in StreamMonitor.
Try latest version
Something must have changed in stripchat, chaturbate for example continues to work without problems