Capto for Tablo (CLI Grabber)

Thanks, I tried the 0.5 version, but get the same result with the unquoted string error:

jmenke@emily:~/tablodump$ capto -e 1035648 -f plex
[capto] datetime => Sun Nov 26 07:00:00 2017
[capto] duration => 2114
[capto] epid => 1035648
[capto] episode => 04
[capto] epoch => 1511701200
[capto] eptitle => Tunnels, Beakmania & Trains
[capto] recid => 914411
[capto] season => 02
[capto] series => Beakman's World
[capto] title => Beakman's World - s02e04 - Tunnels, Beakmania & Trains
[capto] type => series
[capto] watchid => 1035648
[capto]
[capto] [Control-C to Abort]
[capto]
[capto] Beakman's World - s02e04 - Tunnels, Beakmania & Trains.mp4
sh: 1: Syntax error: Unterminated quoted string
[capto]
[capto] Export Completed in: 0h 0m 6s

Also, it looks like perl isn’t properly populating the include path, as it can’t find utf8_heavy, which is located in the same path where it pulled utf8.pm:

jmenke@emily:~/tablodump$ capto -s Painting
Can't locate utf8_heavy.pl in @INC (@INC contains: /tmp/par-6a6d656e6b65/cache-167dafd6df8ada86d94a1d67988ba75da6c65d14/inc/lib /tmp/par-6a6d656e6b65/cache-167dafd6df8ada86d94a1d67988ba75da6c65d14/inc CODE(0x55f9b9f97540) CODE(0x55f9b9f97738)) at /usr/share/perl/5.24/utf8.pm line 16.

jmenke@emily:~/tablodump$ locate utf8_heavy.pl
/usr/lib/x86_64-linux-gnu/perl-base/utf8_heavy.pl
/usr/share/perl/5.24.1/utf8_heavy.pl

(/usr/share/perl/5.24 is a symlink to /usr/share/perl.5.24.1):

jmenke@emily:~/tablodump$ ls -alh /usr/share/perl/5.24
lrwxrwxrwx 1 root root 6 Sep 25  2016 /usr/share/perl/5.24 -> 5.24.1

Im not sure here. I tricked mine to use your title for testing and its working fine. Sure you’re on 0.5?

nexus/root# /root/Dropbox/linux/capto/capto.pl -e 491136 -f plex
[capto] datetime => Wed Sep 12 22:30:00 2018
[capto] duration => 7279
[capto] epid => 491136
[capto] episode => 00
[capto] epoch => 1536816600
[capto] eptitle =>
[capto] recid => 491136
[capto] season => 00
[capto] series =>
[capto] title => Beakman’s World - s02e04 - Tunnels, Beakmania & Trains
[capto] type => movie
[capto] watchid => 491135
[capto]
[capto] [Control-C to Abort]
[capto]
[capto] Beakman’s World - s02e04 - Tunnels, Beakmania & Trains.mp4
[capto] Progress: 00:03:05 / 02:01:19 (speed 18.5x) (size 39.87MB) [3%]

This is a problem with your perl install / system.

Maybe it fails with the first quote in series name. Which your test didn’t have.

[capto] series => Beakman’s World

Ill try that too. im building all 3 new 0.6 versions with updated ffmpegs. ill try to work on that quote issue before releasing.

Yes, definitely 0.5:
jmenke@emily:~$ which capto
/home/jmenke/bin/capto
jmenke@emily:~$ ls -alh which capto
lrwxrwxrwx 1 jmenke jmenke 35 Nov 8 21:38 /home/jmenke/bin/capto -> /home/jmenke/capto.v0.5.linux/capto

It appeared you used PAR Packer 1.036 to compile capto. https://metacpan.org/pod/pp notes:

If your packed program exits with an error message like

Can't locate utf8_heavy.pl in @INC (@INC contains: ...)

Same as @johnmenke, implying it’s not user issue. Suggesting the developer:

try to pack it with -u (or use -x).

-u , –unicode

Package Unicode support (essentially utf8_heavy.pl and everything below the directory unicore in your perl library).

This option exists because it is impossible to detect using static analysis if your program needs Unicode support at runtime. (Note: If your program contains use utf8 this does not imply it needs Unicode support. It merely says that your program is written in UTF-8.)

He shows perl 5.24 mine shows 5.26 and 5.28 - maybe just enough changed between whatever version you started with.

Ok, version 0.6 is on the site for linux only.

changelog:

  • built with Package Unicode support
  • more attempts to fix bad characters crashing the program
  • added version switch (-v)
  • updated ffmpeg for all platforms
  • added link to gnu license for ffmpeg (to keep djk44883’s head from exploding)

once its been tested ill update the other platforms. if its still broke ill keep making 0.6 versions until its not.

You’ve done great work! One note, seems if I use -f and don’t specify .mp4 nothing happens.

/media/dvr$ capto -e 7728 -f Manifest -ffmpeg /usr/bin/ffmpeg
[capto] ffmpeg path set to: /usr/bin/ffmpeg
[capto] datetime => Mon Nov 05 22:00:00 2018
[capto] duration => 3682
[capto] epid => 7728
[capto] episode => 06
[capto] epoch => 1541473200
[capto] eptitle => Off Radar
[capto] recid => 6832
[capto] season => 01
[capto] series => Manifest
[capto] title => Manifest - s01e06 - Off Radar
[capto] type => series
[capto] watchid => 7728
[capto] 
[capto] [Control-C to Abort]
[capto] 
[capto] Manifest
[capto] Progress:  / 01:01:21 (speed ) (size 0.00MB) [0%]     
[capto] Export Completed in: 0h 0m 0s

add .mp4 to the specified file name

:/media/dvr$ capto -e 7728 -f Manifest.mp4 -ffmpeg /usr/bin/ffmpeg
[capto] ffmpeg path set to: /usr/bin/ffmpeg
[capto] datetime => Mon Nov 05 22:00:00 2018
[capto] duration => 3682
[capto] epid => 7728
[capto] episode => 06
[capto] epoch => 1541473200
[capto] eptitle => Off Radar
[capto] recid => 6832
[capto] season => 01
[capto] series => Manifest
[capto] title => Manifest - s01e06 - Off Radar
[capto] type => series
[capto] watchid => 7728
[capto] 
[capto] [Control-C to Abort]
[capto] 
[capto] Manifest.mp4
^Capto] Progress: 00:02:22 / 01:01:21 (speed 13.6x) (size 90.70MB) [4%]  

I did ^C, but you can see the progress differences. And I did run ./capto from the archive dir with the distributed ffmpeg and same results.

Other than kind of knowing what it does, I have no real understanding of ffmpeg. When I use it to extract the files with out .mp4 it exits with error,

/media/dvr$ ffmpeg -i http://192.168.1.11:18080/pvr/7728/pl/playlist.m3u8 -bsf:a aac_adtstoasc -vcodec copy -acodec copy -crf 18 Manifest

Unable to find a suitable output format for 'Manifest'
Manifest: Invalid argument

add the extension and it works. So the issue may actually be an ffmpeg ‘thing’.

(I got the extraction line from ferris-tablo there’s a create an mp4 script using avcon)

There is a new v0.6 up that should fix this, please test.

It will auto add .mp4 on the filename if it doesn’t detect it. ffmpeg needs the extension to create the file properly.

Would love it if @johnmenke would test the quote character problem.

I did test the new version…

capto -v
capto v0.6
dj@htpc:~$ capto -e 7728 -f Manifest -ffmpeg /usr/bin/ffmpeg
[capto] ffmpeg path set to: /usr/bin/ffmpeg
[capto] datetime => Mon Nov 05 22:00:00 2018
[capto] duration => 3682
[capto] epid => 7728
[capto] episode => 06
[capto] epoch => 1541473200
[capto] eptitle => Off Radar
[capto] recid => 6832
[capto] season => 01
[capto] series => Manifest
[capto] title => Manifest - s01e06 - Off Radar
[capto] type => series
[capto] watchid => 7728
[capto] 
[capto] [Control-C to Abort]
[capto] 
[capto] Manifest
[capto] Progress:  / 01:01:21 (speed ) (size 0.00MB) [0%]     
[capto] Export Completed in: 0h 0m 0s

Here I first capto -v then ran the command. If you’re telling me there is a new version, with the exact same version number - not sure I can’t keep track of that.

I did test single quote in show title and episode title without issue. Well, if I tried to -f “file name with 'in it.mp4” it still removed it. But file names really souldn’t have them. It overlooks ! in titles and “; , ?” in episode names, haven’t found an ampersand, colon or a paren yet. : ) Someday for some unknown reason they’ll throw a " in there.

It does seem to be working properly now:

jmenke@emily:~/tablodump$ capto -e 914414 -f plex
[capto] datetime => Sun Sep 10 07:00:00 2017
[capto] duration => 2114
[capto] epid => 914414
[capto] episode => 08
[capto] epoch => 1505044800
[capto] eptitle => Sound, Beakmania & Explosions
[capto] recid => 914411
[capto] season => 01
[capto] series => Beakman's World
[capto] title => Beakman's World - s01e08 - Sound, Beakmania & Explosions
[capto] type => series
[capto] watchid => 914414
[capto]
[capto] [Control-C to Abort]
[capto]
[capto] Beakmans World - s01e08 - Sound, Beakmania and Explosions.mp4
[capto] Progress: 00:35:16 / 00:35:14 (speed 19.2x) (size 544.51MB) [100%]
[capto] Export Completed in: 0h 1m 50s
jmenke@emily:~/tablodump$ capto -s Beakman
[capto] [2017-09-10 07:00] (914414) Beakman's World - s01e08 - Sound, Beakmania & Explosions

Also, it the Perl include issue seems to have been resolved:

jmenke@emily:~/tablodump$ capto -s Beakman
[capto] [2017-09-10 07:00] (914414) Beakman's World - s01e08 - Sound, Beakmania & Explosions

Looks good! I’ve run this through some for loops and have moved several shows to Plex, then clearing up about half a terabyte of space on my Tablo disk.

One question… do you have plans for accepting multiple arguments? Deletion takes a while, due to the fact that it’s updating the database after every delete action. It would speed things up if I could pass it multiple arguments after the -d flag so that it would only need to update the database once it has deleted all of them.

Please redownload version 0.6.

new:

  • now ignoring and stripping out the following characters: ’ ’ ! “ ? ; : , "
  • can now delete multiple ids before update with: -d id1,id2,id3,etc

@johnmenke please retest the issue with the quote. make sure i didnt re-break it.

Downloading of titles that contain single quotes still functions.

I tested a bulk deletion from a generated search list:

jmenke@emily:~/tablodump$ echo $(capto -s TV 2>/dev/null | grep Dinosaur\ Train | awk '{print $4}' | sed s/[\(\)]//g | grep -v input) | sed s/\ /,/g
1338497,1338511,1338505,1338520,1341174,1342787,1344452,1344453,1345930,1351833,1353197,1357648,1362054,1372753,1374301,1376048,1376049,1377614,1377626

It appears to have worked just fine:

jmenke@emily:~/tablodump$  capto -d $(echo $(capto -s TV 2>/dev/null | grep Dinosaur\ Train | awk '{print $4}' | sed s/[\(\)]//g | grep -v input) | sed s/\ /,/g)
[capto] updating database, this may take a while...
[capto] DELETED: Dinosaur Train - s01e26 - Confuciusornis Says; Tiny's Tiny Doll
[capto] DELETED: Dinosaur Train - s03e10 - Tiny's Fishing Friend; Butterflies
[capto] DELETED: Dinosaur Train - s04e02 - Rollin' on the Riverboat: Part One; Rollin' on the Riverboat: Part Two
[capto] DELETED: Dinosaur Train - s01e18 - The Burrowers; Shiny's Sea Shells
[capto] DELETED: Dinosaur Train - s01e04 - I'm a T. Rex!; Ned the Quadruped
[capto] DELETED: Dinosaur Train - s01e30 - New Neighbors; Don's Collection
[capto] DELETED: Dinosaur Train - s01e00 - Hootin' Hadrosaurs!; Hatching Party
[capto] DELETED: Dinosaur Train - s04e10 - What's at the Center of the Earth? Troglobites! Minerals!
[capto] DELETED: Dinosaur Train - s01e11 - Derek the Deinonychus; Don's Dragonfly
[capto] DELETED: Dinosaur Train - s01e27 - Iggy Iguanodon; Shiny Can't Sleep
[capto] DELETED: Dinosaur Train - s01e33 - Buck-Tooth Bucky; Tiny's Tiny Place
[capto] DELETED: Dinosaur Train - s02e20 - The Egg Stealer?; To Grandparents' Nest We Go!
[capto] DELETED: Dinosaur Train - s01e23 - Triassic Turtle; Tank's Baby Brother
[capto] DELETED: Dinosaur Train - s01e29 - Long Claws; Tank's Sleep Over
[capto] DELETED: Dinosaur Train - s04e04 - Stop and Smell the Flowers; Moms' Campout
[capto] DELETED: Dinosaur Train - s01e37 - The Amazing Michelinoceras Brothers; Dad's Day Out
[capto] DELETED: Dinosaur Train - s04e09 - What's at the Center of the Earth? Layers!; What's at the Center of the Earth: Fossils!
[capto] DELETED: Dinosaur Train - s04e05 - Where Have All the Lizards Gone?; Conductor's Sleepover
[capto] DELETED: Dinosaur Train - s02e07 - That's Not a Dinosaur; Tiny's Garden
[capto] [1587624] CACHED: Monster Energy Cup Series: Can-Am 500

Much better, thanks for the feature add!

Updated all versions to 0.6. I was having some issues with the mac one so cant promise that will work. I cant seem to update my original post which sucks.

changelog

v0.6

  • built with Package Unicode support
  • more attempts to fix bad characters crashing the program
  • added version switch (-v)
  • updated ffmpeg for all platforms
  • added link to gnu license for ffmpeg (to keep djk44883’s head from exploding)
  • will auto add .mp4 to files that do not contain it
  • added this changelog to the packages
  • now ignoring and stripping out the following characters: ’ ’ ! “ ? ; : , "
  • can now delete multiple ids before update with: -d id1,id2,id3,etc
1 Like

Can’t run on Mac OS Mojave:

Manta:capto.v0.6.macos jkeenan$ ./capto -u 192.168.111.25
Can't locate JSON.pm in @INC (you may need to install the JSON module) (@INC contains: CODE(0x7fc1a0da1458) /var/folders/j5/hp16sj9j077g4c8cszk56pv80000gq/T/par-6a6b65656e616e/cache-614779a50441313fe3639a87e1dcffeb89149e6f/inc/lib /var/folders/j5/hp16sj9j077g4c8cszk56pv80000gq/T/par-6a6b65656e616e/cache-614779a50441313fe3639a87e1dcffeb89149e6f/inc CODE(0x7fc1a0c8e5b0) CODE(0x7fc1a0c8eb00)) at script/capto.pl line 7.
BEGIN failed--compilation aborted at script/capto.pl line 7.

All the steps on the linked web page were followed.

Manta:capto.v0.6.macos jkeenan$ sudo cpanm install JSON
Password:
install is up to date. (0.01)
JSON is up to date. (2.97001)

Which I warned about in my previous post. I haven’t been able to find a fix. Apple loves to break their very expensive crap.

capto seems to be working fine, other than actually downloading:

% capto -e 829605 -f out.mp4

[capto] datetime => Sun Nov 25 19:00:00 2018
[capto] duration => 3682
[capto] epid => 829605
[capto] episode => 02
[capto] epoch => 1543190400
[capto] eptitle => Surviving the Holocaust
[capto] recid => 627041
[capto] season => 02
[capto] series => We'll Meet Again
[capto] title => We'll Meet Again - s02e02 - Surviving the Holocaust
[capto] type => series
[capto] watchid => 829605
[capto]
[capto] [Control-C to Abort]
[capto]
[capto] out.mp4
[capto] Progress:  /  (speed ) (size 0.00MB) [0%]
[capto] Export Completed in: 0h 0m 1s

Ubuntu 18.04 (KDE Neon actually), Perl 5.26, ffmpeg 3.4.4, capto versions 0.5 and 0.6, Tablo 2.2.22.

Any ideas?