Sunday, May 25, 2025

Further Adventures with Segmented Vimeo (and NicoVideo) Videos

 As a follow-up to my previous blog post about segmented Vimeo videos, looks like a lot of things have changed since then.

Before, you could get lucky by searching through the network traffic for a direct URL for an mp4 file or even a 9-digit video file ID. Nowadays, I can't even find the master.json file to get the URL.

But I did find a playlist.json file, whose complete URL looks like this: https://vod-adaptive-ak.vimeocdn.com/exp=1746859637~acl=%2F2aed1a26-82e0-4e71-88b4-66b640063a50%2F%2A~hmac=406565bd4b1a97f835870e579db1914821de4d3308674c3679e3653ccdf5192f/2aed1a26-82e0-4e71-88b4-66b640063a50/v2/playlist/av/primary/playlist.json?omit=av1-hevc&pathsig=8c953e4f~ukiVn0xgiuGdzWbAuE_LQry4ltouJ-enH_rU-rIefIU&r=dXM%3D&rh=3fnUuf

Tried below ffmpeg command, but got an error:

ffmpeg -protocol_whitelist file,http,https,tcp,tls,crypto -i "https://vod-adaptive-ak.vimeocdn.com/exp=1746859637~acl=%2F2aed1a26-82e0-4e71-88b4-66b640063a50%2F%2A~hmac=406565bd4b1a97f835870e579db1914821de4d3308674c3679e3653ccdf5192f/2aed1a26-82e0-4e71-88b4-66b640063a50/v2/playlist/av/primary/playlist.json?omit=av1-hevc&pathsig=8c953e4f~ukiVn0xgiuGdzWbAuE_LQry4ltouJ-enH_rU-rIefIU&r=dXM%3D&rh=3fnUuf" -c copy video.mp4

Tried changing the URL from json to mpd, but still didn't work:

ffmpeg -protocol_whitelist file,http,https,tcp,tls,crypto -i "https://vod-adaptive-ak.vimeocdn.com/exp=1746859637~acl=%2F2aed1a26-82e0-4e71-88b4-66b640063a50%2F%2A~hmac=406565bd4b1a97f835870e579db1914821de4d3308674c3679e3653ccdf5192f/2aed1a26-82e0-4e71-88b4-66b640063a50/v2/playlist/av/primary/playlist.mpd" -c copy video.mp4

And apparently, these vimeo URLs time out and get refreshed after less than 5 minutes.

Did some searching and found a working solution: https://github.com/martiGIT/vimeo-download-by-playlist

There's another downloader that runs as a Docker container, which should also work: https://github.com/davidecavestro/vimeo-dl

While we're on the topic of dowloading videos, I found a working downloader for Niconico (aka Nico Nico Douga) videos: https://github.com/AlexAplin/nndownload

I was looking for YOASOBI's performance of Idol during the 74th NHK Kōhaku Uta Gassen (2023), and was told that it can only be found on Niconico, so here we are.    

Monday, April 28, 2025

Plex Media Server on DietPi


After more than a year of troubleshooting on and off, I managed to get the Plex app on the PS5 to connect to the Plex Media Server hosted on my DietPi.

I do have Jellyfin running on the Amazon Fire TV Stick (4K Max), but on the Sony PS5, the only option I have is Plex. The first I tried it, Plex was able to see Plex Media Server installed on the DietPi, but it just won't connect to it.

Fast-forward to today. I thought maybe after a year, whatever bug would've been fixed, so I gave it another shot.
Installation on the DietPi is pretty straightforward. Select application from the list, install, and done. Linking the Plex app to the Plex Media Server is just a matter of logging in and typing in the link code provided.

The PS5 Plex app is able to see the Plex server, the server is able to see the PS5 as a client. However, the PS5 is reporting the Plex server us unavailable / unreachable. They're on the same wired network with no firewall in between. Same problem as before.

Looked into a lot of forum posts, people talk about:
  • DNS rebinding
  • domain whitelisting
  • setting plex.direct as private domain
  • switching to public DNS servers
  • getting your own domain certificate and switching to HTTPS

In the end, I did only two things:
  1. added custom URL (https://local.ip:port and http://local.ip:port)
  2. changed PS5 DNS to the one provided by the ISP, rather than my own pihole/unbound

Connected straightaway and worked as expected.

Wednesday, March 12, 2025

Dell Wyse 5060 SSD Upgrade

I've been using a Dell Wyse 5060 thin client as a Docker box using DietPi. It came with an Apacer 64 GB SSD. With more Docker containers being added and more media (ebooks, audiobooks, documents, etc.) being uploaded, I needed to upgrade the storage.

I watched a couple of YouTube videos about it and it looks simple enough. Open up the case, remove SSD, replace with new SSD, and voila!

Prior to the hardware upgarde, I did take a backup using dietpi-backup utility. It saves the specified folders in /mnt/dietpi-backup/data, and a dietpi-backup.log is generated and a hidden .dietpi-backup_stats file records the start and end time. To make a copy of the backup for offline storage, I did a tar cvfz backup.tgz /mnt/dietpi-backup/*

Couple of things to note:

  • The SSD used is mSATA. That said, not all mSATA modules are the same size. I extracted my replacement from an ADATA SU650 SSD, and the module is wider and longer. No screw in the middle, too.
  • Because of the bigger size, a part of the aluminum shield for the memory modules had to be removed/reduced for the SSD module to fit.
  • When you run tar with a wildcard, hidden dotfiles are not captured and archived. And because the hidden .dietpi-backup_stats file was not archived by tar, dietpi-backup refused to restore my backup. I had to reconnect the original SSD, mount the USB stick, copy the missing hidden file to the USB stick, connect the new SSD, mount the USB stick, then copy over the missing hidden file.
  • OR I could've just manually create and edit a new .dietpi-backup_stats file:
    • YYYY-MM-DD_hh:mm:ss  Backup starting
    • YYYY-MM-DD_hh:mm:ss  Backup completed

The better way of performing the backup/restore is:

  1. cd /mnt/dietpi-backup; tar cvfz /root/backup.tgz . (this will archive even hidden files in /mnt/dietpi-backup)
  2. cd /mnt/dietpi-backup; tar xvfz backup.tgz or tar xvfz /root/backup.tgz (depending where tgz is located)

I also did notice that the installer didn't seem to make use of my settings for /boot/dietpi.txt. It still asked for locale, keyboard settings, layout, etc.

On first boot, make sure network connection is there. DietPi wants to do apt update as part of first boot and will complain if it can't. Restore process also requires apt update, so provide network ASAP.

Also, prior to the backup process, make sure the OS, apps and packages are up-to-date. Purge old files, logs, backups, and Docker images. This drastically reduces backup and restore times.


Wednesday, March 5, 2025

直讀中文 cBook


I remember with fondness Ian Wong's 直讀中文 cBook app.
There used to be a time when I read a lot of ebooks and this is one of the apps that I regularly use.
I hear you asking, if it's just ebooks, why not just use Moon+ Reader or Google Play Books or a physical ebook reader like Kobo or Kindle?

The unique thing about cBook is that it can only render Chinese ebooks. Kobos and Kindles can also handle Chinese epubs and AZW/AZW3, but cBook presents the text the correct way - right to left and top to bottom.
Another interesting thing about cBook: it can only open ebooks from HaoDoo using the pdb and updb formats.

So I got a new tablet and installed the latest version of cBook from the Play Store - 4.0.0Beta5. The ebook download function doesn't seem to work anymore, so I had to manually copy over my old pdb/updb files to /cBook folder. The app seems to be able to locate the folder, but it's saying there are zero files within.

Went to Ian Wong's personal website to download old APKs of the app, but the Dropbox links are not working anymore. After a bit of searching, I found a copy of version 3.2.0. Installed that and it was actually able to see the ebooks.

After some testing, it turns out that cBook needs permission to "Files and Media", but doesn't ask for it. Once I granted the permission, cBook 4.0.0beta5 now works as expected.

Thursday, February 20, 2025

Flashing the Samsung SM-S9260


Wife was gifted a Samsung Galaxy S24+ phone bought from China.

Now I know that phones sold in China don't support Google services or apps. But when I checked the phone, it does have the Google Play Store installed. I didn't even bother installing more Google apps or testing if they work or not. I've had an S9+ bought in China before. Google apps install fine, but they don't really work 100%. Best thing to do is to replace the firmware with something else ASAP.

For the specific SM-S9260 model, you have a choice of firmware for China, Taiwan or Hong Kong. For guaranteed Google compatibility, I chose TGY (Hong Kong). It is possible to flash firmware from other regions (CSC), but there could be complications if the firmware if not meant for the hardware.

Two options to download the latest firmware:

  1. from SamFW, which is the successor of SamMobile
  2. or via Frija, which downloads directly from Samsung FUS (Firmware Update Server) for fastest throughput

Frija has an auto mode, which detects your phone's model and CSC and downloads the latest compatible firmware. You can also use manual mode, where you enter the phone's model, CSC, and SN/IMEI, and it will present the latest firmware for it.

Once all the files have been downloaded, run Odin and load the binaries to their corresponding fields.

Power off the S24+ by pressing Vol Down + Power buttons.

Connect the S24+ to a computer using a USB cable, then power up the phone into download mode by pressing both Vol buttons + Power button.

Flash the firmware binaries using Odin. Phone will auto-reboot after success flashing.