user-1350
25-07-2016, 12:25 PM
You need to use different ffmpeg commands to generate mp3/mkv output, but there's no way I can see to include those commands in the options file so they are used for every get-iplayer run. I edited my local copy to include these bits:
jason@dino:/mnt/3tb_0/iplayer_downloads$ diff ~/bin/gip_test $(which get-iplayer)
4419,4426c4419
< if ( $prog->{type} =~ /radio/ ) {
< ( $opt->{radiocommand} = $opt->{command} ) if $opt->{command};
< $prog->run_user_command( $opt->{radiocommand} ) if $opt->{radiocommand};
< }
< if ( $prog->{type} =~ /tv/ ) {
< ( $opt->{tvcommand} = $opt->{command} ) if $opt->{command};
< $prog->run_user_command( $opt->{tvcommand} ) if $opt->{tvcommand};
< }
---
> $prog->run_user_command( $opt->{command} ) if $opt->{command};
4443,4449c4436,4437
< if ( $prog->{type} =~ /radio/ ) {
< ( $opt->{radiocommand} = $opt->{command} ) if $opt->{command};
< $prog->run_user_command( $opt->{radiocommand} ) if $opt->{radiocommand};
< }
< if ( $prog->{type} =~ /tv/ ) {
< ( $opt->{tvcommand} = $opt->{command} ) if $opt->{command};
< $prog->run_user_command( $opt->{tvcommand} ) if $opt->{tvcommand};
---
> if ( $opt->{command} && ! $opt->{nowrite} ) {
> $prog->run_user_command( $opt->{command} );
8235d8222
< tvcommand => [ 1, "tvc|tvcommand=s", 'Output', '--tvcommand, -tvc <command>', "Run user command after successful recording using args such as <pid>, <name> etc"],
9511d9497
< radiocommand => [ 1, "rc|radiocommand=s", 'Output', '--radiocommand, -rc <command>', "Run user command after successful recording using args such as <pid>, <name> etc"],
That allows me to have radiocommand and tvcommand lines as defaults in options, which are happily parsed and seem to be correctly used when fetching programmes. Any chance you can implement something similar, or point me at the options that make it unnecessary?
jason@dino:/mnt/3tb_0/iplayer_downloads$ diff ~/bin/gip_test $(which get-iplayer)
4419,4426c4419
< if ( $prog->{type} =~ /radio/ ) {
< ( $opt->{radiocommand} = $opt->{command} ) if $opt->{command};
< $prog->run_user_command( $opt->{radiocommand} ) if $opt->{radiocommand};
< }
< if ( $prog->{type} =~ /tv/ ) {
< ( $opt->{tvcommand} = $opt->{command} ) if $opt->{command};
< $prog->run_user_command( $opt->{tvcommand} ) if $opt->{tvcommand};
< }
---
> $prog->run_user_command( $opt->{command} ) if $opt->{command};
4443,4449c4436,4437
< if ( $prog->{type} =~ /radio/ ) {
< ( $opt->{radiocommand} = $opt->{command} ) if $opt->{command};
< $prog->run_user_command( $opt->{radiocommand} ) if $opt->{radiocommand};
< }
< if ( $prog->{type} =~ /tv/ ) {
< ( $opt->{tvcommand} = $opt->{command} ) if $opt->{command};
< $prog->run_user_command( $opt->{tvcommand} ) if $opt->{tvcommand};
---
> if ( $opt->{command} && ! $opt->{nowrite} ) {
> $prog->run_user_command( $opt->{command} );
8235d8222
< tvcommand => [ 1, "tvc|tvcommand=s", 'Output', '--tvcommand, -tvc <command>', "Run user command after successful recording using args such as <pid>, <name> etc"],
9511d9497
< radiocommand => [ 1, "rc|radiocommand=s", 'Output', '--radiocommand, -rc <command>', "Run user command after successful recording using args such as <pid>, <name> etc"],
That allows me to have radiocommand and tvcommand lines as defaults in options, which are happily parsed and seem to be correctly used when fetching programmes. Any chance you can implement something similar, or point me at the options that make it unnecessary?