youtube-dl can't execute PowerShell scripts












-1















I'm trying to get youtube-dl to call a little PowerShell script I made that converts downloaded audio to mp3 while at the same time normalizing it so all songs I download are about the same volume. The problem is that apperently the way youtube-dl is trying to execute the it blocks it:



PS > youtube-dl -i -f bestaudio --exec "powershell D:PowerShellConvertAndNormalize.ps1 {}" https
://www.youtube.com/watch?v=8v_4O44sfjM
[youtube] 8v_4O44sfjM: Downloading webpage
[youtube] 8v_4O44sfjM: Downloading video info webpage
[download] Destination: Christina Perri - Jar of Hearts [Official Music Video]-8v_4O44sfjM.webm
[download] 100% of 4.20MiB in 00:00
[exec] Executing command: powershell D:PowerShellConvertAndNormalize.ps1 "Christina Perri - Jar of Hearts [Official Music Video]-8v_4O44sfjM.webm"
D:PowerShellConvertAndNormalize.ps1 : File D:PowerShellConvertAndNormalize.ps1 cannot be loaded because running
scripts is disabled on this system. For more information, see about_Execution_Policies at
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ D:PowerShellConvertAndNormalize.ps1 Christina Perri - Jar of Hearts ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) , PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
ERROR: Command returned error code 1
PS > Get-ExecutionPolicy
RemoteSigned


Calling the script from powershell directly works as expected:



PS > D:PowerShellConvertAndNormalize.ps1 "Christina Perri - Jar of Hearts [Official Music Video]
-8v_4O44sfjM.webm"


How can I make youtube-dl call my PowerShell script?










share|improve this question


















  • 1





    You have a security exception. Your error message tells you what to do. Go to https:/go.microsoft.com/fwlink/?LinkID=135170 and follow the instructions.

    – DavidPostill
    Jan 5 at 22:37













  • First time I went there I overlooked the switch for powershell.exe with -ExecutionPolicy as you can see above I already set the execution policy for the system to RemoteSigned and thought that would do it.

    – usbpc102
    Jan 6 at 16:58
















-1















I'm trying to get youtube-dl to call a little PowerShell script I made that converts downloaded audio to mp3 while at the same time normalizing it so all songs I download are about the same volume. The problem is that apperently the way youtube-dl is trying to execute the it blocks it:



PS > youtube-dl -i -f bestaudio --exec "powershell D:PowerShellConvertAndNormalize.ps1 {}" https
://www.youtube.com/watch?v=8v_4O44sfjM
[youtube] 8v_4O44sfjM: Downloading webpage
[youtube] 8v_4O44sfjM: Downloading video info webpage
[download] Destination: Christina Perri - Jar of Hearts [Official Music Video]-8v_4O44sfjM.webm
[download] 100% of 4.20MiB in 00:00
[exec] Executing command: powershell D:PowerShellConvertAndNormalize.ps1 "Christina Perri - Jar of Hearts [Official Music Video]-8v_4O44sfjM.webm"
D:PowerShellConvertAndNormalize.ps1 : File D:PowerShellConvertAndNormalize.ps1 cannot be loaded because running
scripts is disabled on this system. For more information, see about_Execution_Policies at
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ D:PowerShellConvertAndNormalize.ps1 Christina Perri - Jar of Hearts ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) , PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
ERROR: Command returned error code 1
PS > Get-ExecutionPolicy
RemoteSigned


Calling the script from powershell directly works as expected:



PS > D:PowerShellConvertAndNormalize.ps1 "Christina Perri - Jar of Hearts [Official Music Video]
-8v_4O44sfjM.webm"


How can I make youtube-dl call my PowerShell script?










share|improve this question


















  • 1





    You have a security exception. Your error message tells you what to do. Go to https:/go.microsoft.com/fwlink/?LinkID=135170 and follow the instructions.

    – DavidPostill
    Jan 5 at 22:37













  • First time I went there I overlooked the switch for powershell.exe with -ExecutionPolicy as you can see above I already set the execution policy for the system to RemoteSigned and thought that would do it.

    – usbpc102
    Jan 6 at 16:58














-1












-1








-1








I'm trying to get youtube-dl to call a little PowerShell script I made that converts downloaded audio to mp3 while at the same time normalizing it so all songs I download are about the same volume. The problem is that apperently the way youtube-dl is trying to execute the it blocks it:



PS > youtube-dl -i -f bestaudio --exec "powershell D:PowerShellConvertAndNormalize.ps1 {}" https
://www.youtube.com/watch?v=8v_4O44sfjM
[youtube] 8v_4O44sfjM: Downloading webpage
[youtube] 8v_4O44sfjM: Downloading video info webpage
[download] Destination: Christina Perri - Jar of Hearts [Official Music Video]-8v_4O44sfjM.webm
[download] 100% of 4.20MiB in 00:00
[exec] Executing command: powershell D:PowerShellConvertAndNormalize.ps1 "Christina Perri - Jar of Hearts [Official Music Video]-8v_4O44sfjM.webm"
D:PowerShellConvertAndNormalize.ps1 : File D:PowerShellConvertAndNormalize.ps1 cannot be loaded because running
scripts is disabled on this system. For more information, see about_Execution_Policies at
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ D:PowerShellConvertAndNormalize.ps1 Christina Perri - Jar of Hearts ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) , PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
ERROR: Command returned error code 1
PS > Get-ExecutionPolicy
RemoteSigned


Calling the script from powershell directly works as expected:



PS > D:PowerShellConvertAndNormalize.ps1 "Christina Perri - Jar of Hearts [Official Music Video]
-8v_4O44sfjM.webm"


How can I make youtube-dl call my PowerShell script?










share|improve this question














I'm trying to get youtube-dl to call a little PowerShell script I made that converts downloaded audio to mp3 while at the same time normalizing it so all songs I download are about the same volume. The problem is that apperently the way youtube-dl is trying to execute the it blocks it:



PS > youtube-dl -i -f bestaudio --exec "powershell D:PowerShellConvertAndNormalize.ps1 {}" https
://www.youtube.com/watch?v=8v_4O44sfjM
[youtube] 8v_4O44sfjM: Downloading webpage
[youtube] 8v_4O44sfjM: Downloading video info webpage
[download] Destination: Christina Perri - Jar of Hearts [Official Music Video]-8v_4O44sfjM.webm
[download] 100% of 4.20MiB in 00:00
[exec] Executing command: powershell D:PowerShellConvertAndNormalize.ps1 "Christina Perri - Jar of Hearts [Official Music Video]-8v_4O44sfjM.webm"
D:PowerShellConvertAndNormalize.ps1 : File D:PowerShellConvertAndNormalize.ps1 cannot be loaded because running
scripts is disabled on this system. For more information, see about_Execution_Policies at
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ D:PowerShellConvertAndNormalize.ps1 Christina Perri - Jar of Hearts ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) , PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
ERROR: Command returned error code 1
PS > Get-ExecutionPolicy
RemoteSigned


Calling the script from powershell directly works as expected:



PS > D:PowerShellConvertAndNormalize.ps1 "Christina Perri - Jar of Hearts [Official Music Video]
-8v_4O44sfjM.webm"


How can I make youtube-dl call my PowerShell script?







powershell youtube-dl






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 5 at 22:27









usbpc102usbpc102

1073




1073








  • 1





    You have a security exception. Your error message tells you what to do. Go to https:/go.microsoft.com/fwlink/?LinkID=135170 and follow the instructions.

    – DavidPostill
    Jan 5 at 22:37













  • First time I went there I overlooked the switch for powershell.exe with -ExecutionPolicy as you can see above I already set the execution policy for the system to RemoteSigned and thought that would do it.

    – usbpc102
    Jan 6 at 16:58














  • 1





    You have a security exception. Your error message tells you what to do. Go to https:/go.microsoft.com/fwlink/?LinkID=135170 and follow the instructions.

    – DavidPostill
    Jan 5 at 22:37













  • First time I went there I overlooked the switch for powershell.exe with -ExecutionPolicy as you can see above I already set the execution policy for the system to RemoteSigned and thought that would do it.

    – usbpc102
    Jan 6 at 16:58








1




1





You have a security exception. Your error message tells you what to do. Go to https:/go.microsoft.com/fwlink/?LinkID=135170 and follow the instructions.

– DavidPostill
Jan 5 at 22:37







You have a security exception. Your error message tells you what to do. Go to https:/go.microsoft.com/fwlink/?LinkID=135170 and follow the instructions.

– DavidPostill
Jan 5 at 22:37















First time I went there I overlooked the switch for powershell.exe with -ExecutionPolicy as you can see above I already set the execution policy for the system to RemoteSigned and thought that would do it.

– usbpc102
Jan 6 at 16:58





First time I went there I overlooked the switch for powershell.exe with -ExecutionPolicy as you can see above I already set the execution policy for the system to RemoteSigned and thought that would do it.

– usbpc102
Jan 6 at 16:58










1 Answer
1






active

oldest

votes


















0














I needed to add -ExecutionPolicy RemoteSinged to the command as follows:



PS > youtube-dl -i -f bestaudio --exec "powershell -ExecutionPolicy RemoteSigned D:PowerShelConvertAndNormalize.ps1 {}" https://www.youtube.com/watch?v=8v_4O44sfjM



I'm still not sure what scope I would need to give that to in order to not have to do that but it works so that's all I want.






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1391011%2fyoutube-dl-cant-execute-powershell-scripts%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    I needed to add -ExecutionPolicy RemoteSinged to the command as follows:



    PS > youtube-dl -i -f bestaudio --exec "powershell -ExecutionPolicy RemoteSigned D:PowerShelConvertAndNormalize.ps1 {}" https://www.youtube.com/watch?v=8v_4O44sfjM



    I'm still not sure what scope I would need to give that to in order to not have to do that but it works so that's all I want.






    share|improve this answer




























      0














      I needed to add -ExecutionPolicy RemoteSinged to the command as follows:



      PS > youtube-dl -i -f bestaudio --exec "powershell -ExecutionPolicy RemoteSigned D:PowerShelConvertAndNormalize.ps1 {}" https://www.youtube.com/watch?v=8v_4O44sfjM



      I'm still not sure what scope I would need to give that to in order to not have to do that but it works so that's all I want.






      share|improve this answer


























        0












        0








        0







        I needed to add -ExecutionPolicy RemoteSinged to the command as follows:



        PS > youtube-dl -i -f bestaudio --exec "powershell -ExecutionPolicy RemoteSigned D:PowerShelConvertAndNormalize.ps1 {}" https://www.youtube.com/watch?v=8v_4O44sfjM



        I'm still not sure what scope I would need to give that to in order to not have to do that but it works so that's all I want.






        share|improve this answer













        I needed to add -ExecutionPolicy RemoteSinged to the command as follows:



        PS > youtube-dl -i -f bestaudio --exec "powershell -ExecutionPolicy RemoteSigned D:PowerShelConvertAndNormalize.ps1 {}" https://www.youtube.com/watch?v=8v_4O44sfjM



        I'm still not sure what scope I would need to give that to in order to not have to do that but it works so that's all I want.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 5 at 22:45









        usbpc102usbpc102

        1073




        1073






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1391011%2fyoutube-dl-cant-execute-powershell-scripts%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Probability when a professor distributes a quiz and homework assignment to a class of n students.

            Aardman Animations

            Are they similar matrix