Skip to content

Commit

Permalink
clean up and make package
Browse files Browse the repository at this point in the history
  • Loading branch information
CrispyPin committed Mar 11, 2022
1 parent f7924b5 commit ccbf9fc
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 15 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.exe
*.log
*.zip
17 changes: 14 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
steamapps_path = ${HOME}/.steam/steam/steamapps
appdata_path = ${steamapps_path}/compatdata/438100/pfx/drive_c/users/steamuser/AppData/LocalLow/VRChat/VRChat
vrc_path = ${steamapps_path}/common/VRChat
version = "v1.0.0"


build:
mcs src/main.cs
mcs src/main.cs -out:yt-dlp.exe


install: build
install: yt-dlp.exe
rm -f ${appdata_path}/Tools/yt-dlp.exe
cp src/main.exe ${appdata_path}/Tools/yt-dlp.exe
cp yt-dlp.exe ${appdata_path}/Tools/
chmod -w ${appdata_path}/Tools/yt-dlp.exe

cp src/vrc-video-url-handler.sh ${vrc_path}/vrc-video-url-handler.sh
chmod +x ${vrc_path}/vrc-video-url-handler.sh

sudo cp src/vrc-mpv.py /usr/local/bin/vrc-mpv
sudo chmod +x /usr/local/bin/vrc-mpv


package:
zip vrc-mpv-${version}.zip README.md Makefile src/vrc-mpv.py src/vrc-video-url-handler.sh yt-dlp.exe

15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
# vrchat-linux-video-workaround
Dumb workaround that allows you to play video player content from a vrchat world in mpv instead, since they don't work in proton yet.

## setup
requires `mpv yt-dlp python3 mono`
The latest version can be found at https://github.com/CrispyPin/vrchat-linux-video-workaround

build+install with `make install`
run `vrc-mpv.py` to play videos with mpv when they are requested by vrchat
## Installation
requires `mpv yt-dlp python3`

install with `make install`

run `vrc-mpv` to play videos with mpv when they are requested by vrchat

## building
requires `mono`
`make build && make install`

25 changes: 17 additions & 8 deletions vrc-mpv.py → src/vrc-mpv.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
playing = False
url = ""


def get_url():
global url, URL_PATH
url = ""
Expand All @@ -16,19 +17,27 @@ def get_url():
if s != "":
url = s


def play():
print(f"playing {url}")
os.system(f"mpv {url}")


def delay():
# delay that can be keyboard interrupted
for _ in range(100):
time.sleep(0.01)
for _ in range(10):
time.sleep(0.05)

def main():
print(f"Monitoring {URL_PATH} for a video link...")
print("Ctrl-C to exit")

while True:
delay()
old_url = url
get_url()
if url and url != old_url:
play()

main()

while True:
delay()
old_url = url
get_url()
if url and url != old_url:
play()

0 comments on commit ccbf9fc

Please sign in to comment.