1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-25 09:17:03 +00:00

Update LiveStreamController

This commit is contained in:
Daniel Supernault 2022-06-26 20:42:05 -06:00
parent 4630c5d67a
commit 473cdba855
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -389,11 +389,9 @@ class LiveStreamController extends Controller
public function clientBroadcastFinish(Request $request) public function clientBroadcastFinish(Request $request)
{ {
abort_if(!config('livestreaming.enabled'), 400); abort_if(!config('livestreaming.enabled'), 400);
abort_if(!$request->filled('tcurl'), 400); abort_if($request->ip() != '127.0.0.1', 400);
$url = $this->parseStreamUrl($request->input('tcurl')); $name = $request->input('name');
$name = $url['name'] ?? $request->input('name'); $stream = LiveStream::whereStreamId($name)->firstOrFail();
$stream = LiveStream::whereStreamId($name)->whereStreamKey($url['key'])->firstOrFail();
StreamEnd::dispatch($stream->profile_id); StreamEnd::dispatch($stream->profile_id);
LiveStreamService::clearChat($stream->profile_id); LiveStreamService::clearChat($stream->profile_id);