lossless1024 / StreaMonitor

Adult live stream downloader for advanced people. I could have chosen a better name.
GNU General Public License v3.0
198 stars 52 forks source link

No available sources in Stripchat #82

Closed Ryner95 closed 1 year ago

Ryner95 commented 1 year ago
2023-05-25 12:58:22,202 - INFO - [SC] : Channel online
2023-05-25 12:58:22,280 - ERROR - [SC] : No available sources
2023-05-25 12:58:22,280 - ERROR - [SC] : Error on downloading

Something must have changed in stripchat, chaturbate for example continues to work without problems

SeeingDragon commented 1 year ago

Have you solved it yet ? i also meet the same problem.

Ryner95 commented 1 year ago

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

DerBunteBall commented 1 year ago

For a short view I think they changed to WebRTC in general.

  1. The API issues back all nneded to build the URL. StreaMonitor API call so still works and gets status correctly.
  2. The generated URLs get 403 HTTP Response code. This can be due to new headers or something other BUT
  3. The API call now seems to issue always webrtc as stream type. Also the browser opens a websocket to the coresponding API data.

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.

DerBunteBall commented 1 year ago

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.

Ryner95 commented 1 year ago

Excuse my ignorance but where is it executed?

python script.py username

Ryner95 commented 1 year ago

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 |
+--------------+------------+---------+----------------+
DerBunteBall commented 1 year ago

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"]
            ))
Ryner95 commented 1 year ago

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

Ryner95 commented 1 year ago

Have you solved it yet ? i also meet the same problem.

@SeeingDragon

Temporaly https://github.com/lossless1024/StreaMonitor/issues/82#issuecomment-1563025579

xAstroBoy commented 1 year ago

Yup, i get the error as well now.

joostshao commented 1 year ago

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

aitschti commented 1 year ago

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

xAstroBoy commented 1 year ago

I hope a new fix gets pushed soon, because even @aitschti 's new url format do not work.

aitschti commented 1 year ago

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.

DerBunteBall commented 1 year ago

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.

aitschti commented 1 year ago

@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.

joostshao commented 1 year ago

failed again:

https://github.com/lossless1024/StreaMonitor/issues/90#issue-1780483578

lossless1024 commented 1 year ago

Try latest version