forked from Foxyz/sync_replay_project
yt-dlp for page links in every Link mode; app icon and Linux launcher entry
yt-dlp: a managed, checksum-verified, daily-updated yt-dlp in the app and the dedicated server (--[no-]yt-dlp, --yt-dlp-dir). Pasted links are probed: direct files stay links, pages are resolved for title, uploader, duration and thumbnail. Everyone fetches it: mpv's ytdl hook on the managed copy. I pass it on / the server fetches it: the best single-file format, re-resolved once when its URL expires. Relay names never split the /r/ path; viewers of server-fetched pages wait for the relay to go live. No wire change. Icon: two stars orbiting a play button (assets/icon/icon.svg, PNGs, the Windows .ico). GTK app id moe.senkochan.watch_together; release builds install their .desktop file and icons into ~/.local/share so Wayland shows the icon; the window icon is set for X11. README shows the icon. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9ddd85de90
commit
745717a4a0
40 files changed
+1444
-123
No files matched your search
@@ -34,11 +34,15 @@ class ActiveRelay {
|
||||
{RelayBuffer? buffer, required void Function() onLiveChanged}) =>
|
||||
ActiveRelay._(mediaId, name, sourceToken, buffer ?? RelayBuffer(), null, onLiveChanged);
|
||||
|
||||
/// The server reads [url] itself.
|
||||
/// The server reads [url] itself: a media file as is, a web page
|
||||
/// through [ytDlp]. [onFail] gets the reason when it cannot.
|
||||
static ActiveRelay fetch(int mediaId, String name, Uri url,
|
||||
{RelayBuffer? buffer, required void Function() onLiveChanged}) {
|
||||
{RelayBuffer? buffer,
|
||||
YtDlp? ytDlp,
|
||||
required void Function() onLiveChanged,
|
||||
void Function(String reason)? onFail}) {
|
||||
final b = buffer ?? RelayBuffer();
|
||||
final local = LocalRelayFeed(HttpRelayBytes(url), b);
|
||||
final local = LocalRelayFeed(LinkRelayBytes(url, ytDlp: ytDlp), b);
|
||||
final r = ActiveRelay._(mediaId, name, null, b, local, onLiveChanged);
|
||||
unawaited(() async {
|
||||
try {
|
||||
@@ -48,6 +52,7 @@ class ActiveRelay {
|
||||
onLiveChanged();
|
||||
} catch (e) {
|
||||
_log.warning('relay fetch: cannot read the link: $e');
|
||||
if (!r._disposed) onFail?.call('$e');
|
||||
}
|
||||
}());
|
||||
return r;
|
||||
|
||||
Reference in new issue
Block a user