mattieb / fediplay Goto Github PK
View Code? Open in Web Editor NEWa Mastodon client that automatically plays your friends' music
License: MIT License
a Mastodon client that automatically plays your friends' music
License: MIT License
some people use fediplay, some use nowplaying, some just type np because they are lazy and don't care about namespace collisions
i think it would be cool to have a simple config file that fediplay reads on startup that has one tag per line
We just play the first URL that doesn't look like a mention or a tag right now. We should be pattern-matching them to see if they're something youtube-dl can play, e.g. something from YouTube or Bandcamp or Soundcloud.
afplay(1) is currently hard-wired because I have a MacBook and it can easily handle both MP3s and MP4 videos from YouTube (played headlessly!)
Something more portable would sure be nice.
Given the URL https://wojciechgolczewski.bandcamp.com/album/reality-check-data048, we have:
[Bandcamp:album] reality-check-data048: Downloading webpage
[download] Downloading playlist: Reality Check (DATA048)
[Bandcamp:album] playlist Reality Check (DATA048): Collected 14 video ids (downloading 14 of them)
[download] Downloading video 1 of 14
[Bandcamp] the-puppets-dream: Downloading webpage
[download] Destination: The Puppets Dream-2518381989.mp3
[download] 100% of 4.07MiB in 00:01
[download] Downloading video 2 of 14
[Bandcamp] sid-vortex: Downloading webpage
[download] Destination: Sid Vortex-554140681.mp3
[download] 100% of 2.61MiB in 00:01
[download] Downloading video 3 of 14
[Bandcamp] solitude: Downloading webpage
[download] Destination: Solitude-4076766696.mp3
[download] 100% of 3.39MiB in 00:01
[download] Downloading video 4 of 14
[Bandcamp] insomnia: Downloading webpage
[download] Destination: Insomnia-3389105063.mp3
[download] 100% of 3.37MiB in 00:02
[download] Downloading video 5 of 14
[Bandcamp] impulse: Downloading webpage
[download] Destination: Impulse-219163126.mp3
[download] 100% of 3.18MiB in 00:02
[download] Downloading video 6 of 14
[Bandcamp] check-one: Downloading webpage
[download] Destination: Check One-1754868202.mp3
[download] 100% of 1.39MiB in 00:00
[download] Downloading video 7 of 14
[Bandcamp] find-me: Downloading webpage
[download] Destination: Find Me-2108469611.mp3
[download] 100% of 3.91MiB in 00:02
[download] Downloading video 8 of 14
[Bandcamp] check-two: Downloading webpage
[download] Destination: Check Two-1311262143.mp3
[download] 100% of 1.68MiB in 00:01
[download] Downloading video 9 of 14
[Bandcamp] being-human: Downloading webpage
[download] Destination: Being Human-1823001226.mp3
[download] 100% of 4.84MiB in 00:02
[download] Downloading video 10 of 14
[Bandcamp] gravity: Downloading webpage
[download] Destination: Gravity-587975474.mp3
[download] 100% of 4.96MiB in 00:02
[download] Downloading video 11 of 14
[Bandcamp] the-void: Downloading webpage
[download] Destination: The Void-740723027.mp3
[download] 100% of 3.39MiB in 00:02
[download] Downloading video 12 of 14
[Bandcamp] reality-check: Downloading webpage
[download] Destination: Reality Check-2978114684.mp3
[download] 100% of 2.02MiB in 00:00
[download] Downloading video 13 of 14
[Bandcamp] the-sham-mirrors: Downloading webpage
[download] Destination: The Sham Mirrors-75268257.mp3
[download] 100% of 2.30MiB in 00:01
[download] Downloading video 14 of 14
[Bandcamp] the-architect: Downloading webpage
[download] The Architect-3440302488.mp3 has already been downloaded
[download] 100% of 2.56MiB
[download] Finished downloading playlist: Reality Check (DATA048)
==> Playing The Architect-3440302488.mp3
Which is not ideal. We might be able to watch more hooks to see if we can see all the tracks come in.
Originally posted by @CosineP in #23 (comment)
I don't have any plans to implement this, but I'd like to see this use case being met as part of a larger effort:
Implement playback controls via keystroke or similar once the stream is running.
Implement skip forward to skip over the currently-played song, possibly into wait mode, possibly to play the next song.
Implement skip back to go backward. When we reach the beginning of the stream, start looking back into the timeline.
Maybe we could then implement switching of playback direction, to play in reverse? I'm not yet convinced this is valuable enough to bring into the system. But I could be convinced if someone does the legwork above and then implements reverse playback.
==> Trying https://www.youtube.com/watch?v=GSOHCFxvs8k
[youtube] GSOHCFxvs8k: Downloading webpage
[youtube] GSOHCFxvs8k: Downloading video info webpage
[youtube] GSOHCFxvs8k: Downloading js player vflrZpM9e
ERROR: Signature extraction failed: Traceback (most recent call last):
File "/Users/zigg/.local/share/virtualenvs/fediplay-w1sZ4D7R/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 1210, in _decrypt_signature
video_id, player_url, s
File "/Users/zigg/.local/share/virtualenvs/fediplay-w1sZ4D7R/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 1121, in _extract_signature_function
res = self._parse_sig_js(code)
File "/Users/zigg/.local/share/virtualenvs/fediplay-w1sZ4D7R/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 1182, in _parse_sig_js
jscode, 'Initial JS player signature function name', group='sig')
File "/Users/zigg/.local/share/virtualenvs/fediplay-w1sZ4D7R/lib/python3.7/site-packages/youtube_dl/extractor/common.py", line 972, in _search_regex
raise RegexNotFoundError('Unable to extract %s' % _name)
youtube_dl.utils.RegexNotFoundError: Unable to extract Initial JS player signature function name; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
(caused by RegexNotFoundError('Unable to extract \x1b[0;34mInitial JS player signature function name\x1b[0m; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.')); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Some instances (such as cybre.space) allow uploading of arbitrary files, such as .mp4 files. However, posting these with #fediplay causes youtube-dl to error (verbose log). Mastodon generates a link (such as https://cybre.space/media/4NRv54CHtKJeVeLaokM ) which 302 redirects to the actual file ( https://static.cybre.space/media_attachments/files/000/840/846/original/f735a6d98d8819c8.mp4 ) - However, youtube-dl does not seem to follow this redirect, and its HEAD request gets a 404. If you toot the direct link to the file, fediplay downloads and plays it just fine. I think this may be a bug in youtube-dl (not following redirect) and/or Mastodon (not providing information to HEAD requests), and might only be fixable in either, but I'm investigating to see if youtube-dl has options we can use to make it work correctly.
Removing the media link from the toot results in a different error, but since I think this is the less common practice, the redirect issue is the one to fix first.
Use Pipenv to modernize dealing with dependencies.
Possible idea: instead of downloading files to the current folder, they could be stored in a /files folder (or a folder provided as an argument, for example: a temp file on a ram drive to save space and dump old files on reboot). This can currently be accomplished by making a folder, cding into it, and running ../stream. This does, however, require/generate a new client/usercred.secret file.
After a file has been downloaded, queued, and played, fediplay could automatically delete/archive the file to save disk space. Alternately, the file could be kept around for ~ a day and deleted based on timestamp, in case people liked something and wanted to save it or record the title.
I have a suggestion, it would be probably better to use yt-dlp ( https://github.com/yt-dlp/yt-dlp ) instead of youtube-dl, because yt-dlp is a more updated fork of youtube-dl and it breaks less
am i crazy or do i have to wait for a new #fediplay post before it plays it? can it not look back in my TL and find old posts? cause right now its a whole lotta silence.....
We listen to the home timeline for all posts tagged "#fediplay" right now. It would be nice (and was my original use case!) if we could optionally tell it to listen only to a specific friend for a spell.
After following the link on first run, my instance displays this message:
Client authentication failed due to unknown client, no client authentication included, or unsupported authentication method.
How to reproduce :
We already leave media lying around, why not also output a playlist? Then you could relive a fediplay session anytime.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.