get-iplayer is a Perl script that allows you to download iPlayer programs (there’s no other way to download iPlayer programs on Linux because iPlayer Downloads only runs on Windows and macOS). Obviously you may only download iPlayer programs if you have a TV license and you must delete the programs you’ve downloaded 30 days after they’re shown on TV.
I’ve made good progress on snapping this program thanks to the people in the Perl channel on Freenode and @elopio. I have a working Devmode snap, though I need to silence the locale error and, @wimpress, I can’t seem to just put env LC_ALL=C.UTF-8 in front of scripts/run-cli.pl after command (not that this seems to solve the issue for Neofetch (which I tried this workaround on) anyway).
When trying to run this program confined, I get ERROR: Cannot read options file /etc/get_iplayer/options and I’m not sure what interfaces to give it. If I can’t get it to run confined then I could just try classic confinement. Here’s the output of grep "audit:" /var/log/syslog. As usual, sudo /snap/bin/snappy-debug.security scanlog get-iplayer (use suggested here) seems to just hang for me.
Building this snap won’t work using build.snapcraft.io (which uses Ubuntu 16.04, or has that changed?) because the versions of ffmpeg and atomicparsley are too out-of-date there. So when asking upstream if they want to build this themselves I guess I can just suggest they use Launchpad. Alternatively I need to convert ffmpeg and atomicparsley into parts. This seems easy enough with atomicparsley but I’m not sure what config flags to use for ffmpeg. Peek uses an ffmpeg part which seems to work and at the bottom of this page are the features that get-iplayer needs from ffmpeg.
How do I confine this?
I need thoughts on whether I should convert atomicparsley and ffmpeg into parts instead of using the Deb packages. If I should convert ffmpeg into a part then what config flags do I use for it?
@wimpress I need help with the locale error for this app
For the locale error you might like to try adding:
to the part, and launching the script with bin/desktop-launch. Obviously this isn’t an ideal solution, but it might point you in the right direction. I had similar problems with youtube-dl and this removed the locale related errors. I haven’t had a chance to track down a real solution yet.
Note, as invoked, scanlog will tail the file, looking for new denials. If it doesn’t find any, it will look like is it hanging. If this is not working for you, can you give the details of the OS, snapd version, snappy-debug version and exact steps to reproduce (eg, it works fine here with sudo snappy-debug.security scanlog hello-world, then starting hello-world.sh and doing ls /)
you need to adjust your program to look for /etc/get_iplayer/options somewhere else. This file isn’t going to exist on a typical system and your snap needs to provide it in one of the data dirs, eg, $SNAP, $SNAP_DATA, $SNAP_COMMON, $SNAP_USER_DATA or $SNAP_USER_COMMON
(this is actually what snappy-debug scanlog should’ve suggested to you)
Ah, the documentation doesn’t make it clear that the snappy-debug command should be run before the strict snap is run? It does indeed work when I have them both running simultaneously
How do I do that without rewriting the get-iplayer Perl script? I thought we should be able to snap applications without having to rewrite them? This is the line of the script that sets that directory…
Regarding snappy-debug-- it depends on how it is invoked. The default behavior is to tail and show only new violations.
As for being able to snap applications without having to rewrite them: it depends on the software. If the software uses a lot of hard-coded paths or assumptions about the OS and/or is generally not portable, then it might need updating (this isn’t strictly unique to snappy). Since it is a perl script, you might be able to perform a strategic sed as part of your snapcraft build. Alternatively, you might also be interested in the snapcraft-preload part: https://github.com/sergiusens/snapcraft-preload
I’m getting the error below on build.snapcraft.io (since I have a separate repo for this now (which I will transfer to snapcrafters if I can get this working and get the locale error fixed…) here’s the GitHub Issue for this issue if you’d rather respond there):
Parts 'atomicparsley' and 'get-iplayer' have the following file paths in common which have different contents:
I’ve tried adding organize to both parts to rename README.md, I’ve tried using mv. No luck. Any ideas?