Lazy DOS interface for Python SCDL-CANT EDIT ANYMORE

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Kaliados
Posts: 1
Joined: 18 Nov 2018 15:53

Lazy DOS interface for Python SCDL-CANT EDIT ANYMORE

#1 Post by Kaliados » 24 Nov 2018 13:46

I have a Batch file I use to run a few different argument types for downloading Soundcloud music.
Utilizing 'scdl' through Python.

I decided when I made the DOS file for a friend, to have an ASCII art look.
So I used ' for /f "delims=: tokens=*" %%A in ('findstr /b ::: "%~f0"') do @echo(%%A'
and stored my ASCII art at the bottom of the code with ':::' replacing echo.

When I came back to refining the code I ran into a bit of a wall that I am just baffled on, and would like some outside aide.
Any edit I do to the script breaks the code, where my echoed strings come out with my directory first. IE (IF 'ECHO HI', it would be "C:\location\of\file>ECHO HI")
For the most part the script works fine, but I wrote it in a rush, so some of the ends are kinda fukt.
For example.
I cant change my second condition with :2, and try to end it with goto 2.
I cant even add a MODE atop the script without it breaking.
https://gist.github.com/CristenPerret/9 ... 6342ac4d6e

Code: Select all

@echo off
SETLOCAL
@setlocal enableextensions enabledelayedexpansion
scdl --version

:: ASCII ART TRIGGER CHECK BOTTOM
:: for /f "delims=: tokens=*" %%A in ('findstr /b ::: "%~f0"') do @echo(%%A


:start
cls
for /f "delims=: tokens=*" %%A in ('findstr /b ::: "%~f0"') do @echo(%%A
ECHO:
ECHO 1 - Download one track 
ECHO 2 - Download all liked songs by a SC user
ECHO 3 - Download all songs posted by SC user
ECHO 4 - Download all posted, and liked songs by SC user
ECHO 5 - EXIT

:: the choice command

set pass=
choice /c 12345 /n /m ""
set pass=%errorlevel%

:: the choices

if errorlevel 1 set goto=1
if errorlevel 2 set goto=2
if errorlevel 3 set goto=3
if errorlevel 4 set goto=4
if errorlevel 5 set goto=exit
goto %goto%

pause
cls


:1
cls
for /f "delims=: tokens=*" %%A in ('findstr /b ::: "%~f0"') do @echo(%%A
Echo .
ECHO YOUR DOWNLOAD PATH WILL BEGIN FROM %cd%. 
ECHO Open Batch in desired folder to change path.
Echo .
set /p URL=Paste the exact track URL Here: 
IF [%URL%] == [] GOTO start
scdl -l %URL% --min-size "500k" --extract-artist --addtofile --download-archive archive.txt -c
ECHO You must face your enemies without the tools you've come to rely on. 
pause
cls
goto 1


:2
cls
for /f "delims=: tokens=*" %%A in ('findstr /b ::: "%~f0"') do @echo(%%A
Echo .
ECHO YOUR DOWNLOAD PATH WILL BEGIN FROM %cd%. 
ECHO Open Batch in desired folder to change path.
Echo .
set /p URL=Paste the SoundCloud User URL Here: 
IF [%URL%] == [] GOTO start
scdl -l %URL% --min-size "500k" --extract-artist --addtofile --download-archive archive.txt -f -c
ECHO You must face your enemies without the tools you've come to rely on. 
pause
goto all-likes

:3
cls
for /f "delims=: tokens=*" %%A in ('findstr /b ::: "%~f0"') do @echo(%%A
Echo .
ECHO YOUR DOWNLOAD PATH WILL BEGIN FROM %cd%. 
ECHO Open Batch in desired folder to change path.
Echo .
set /p URL=Paste the SoundCloud User URL Here: 
IF [%URL%] == [] GOTO start
scdl -l %URL% --min-size "500k" --extract-artist --addtofile --download-archive archive.txt -t -c
ECHO You must face your enemies without the tools you've come to rely on. 
pause
cls
goto 3

:4
cls
for /f "delims=: tokens=*" %%A in ('findstr /b ::: "%~f0"') do @echo(%%A
Echo .
ECHO YOUR DOWNLOAD PATH WILL BEGIN FROM %cd%. 
ECHO Open Batch in desired folder to change path.
Echo .
set /p URL=Paste the SoundCloud User URL Here:
IF [%URL%] == [] GOTO start 
scdl -l %URL% --min-size "500k" --extract-artist --addtofile --download-archive archive.txt -m -c
ECHO You must face your enemies without the tools you've come to rely on. 
pause
cls
goto 4



:exit
exit
:::
:::            @@@@@@@@@@@@@@@@@@@@@@@@@@@@        
:::       @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
:::      @@@@@@@@SOUNDCLOUD DOWNLOADER@@@@@@@@@@@@
:::    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
:::   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
:::   @@@@@@@@@@@@@@  '.@@@@@@@@@@@@@@@@@.--.@@@@@@@@@
:::     @@@@@@@@\   @@  ¯ @@@@@@@@@@@ '¯¯ ___..@@@@@@
:::      @@@@@@@@|                 @    .'@@@@@@@@@@
:::         @@@@@@\                    /@@@@@@@@
:::                \                  /
:::                |   .--'|__|'--.   |
:::                |  /.--'/  \'--.\  |
:::    __  ___     /      /____\      \     ___
:::  _(  )(   )_  |     .' .''. '.     |  _(   )__  __      __
::: (           )_|    |__/    \__|    |_(        )(  )_   (
:::              /                      \__             )_(¯
::: _______.---./    .'       COPY          \_.--._ ___________
:::   --''¯        _/    __  PASTA                '--..       
:::              ''    .'   THE URL AND PRESS ENTER BELOW!!!
:::This trial shall test your courage to ensure you are worthy of this splendor.

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: Lazy DOS interface for Python SCDL-CANT EDIT ANYMORE

#2 Post by Squashman » 24 Nov 2018 17:15

I am not understanding what you mean by DOS interface and DOS file.

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: Lazy DOS interface for Python SCDL-CANT EDIT ANYMORE

#3 Post by Ed Dyreen » 24 Nov 2018 18:26

Squashman wrote:
24 Nov 2018 17:15
I am not understanding what you mean by DOS interface and DOS file.
a fancy name for batch script ?

Code: Select all

@echo off
SETLOCAL
@setlocal enableextensions enabledelayedexpansion
scdl --version

:: ASCII ART TRIGGER CHECK BOTTOM
:: for /f "delims=: tokens=*" %%A in ('findstr /b ::: "%~f0"') do @echo(%%A


:start
cls
for /f "delims=: tokens=*" %%A in ('findstr /b ::: "%~f0"') do @echo(%%A
ECHO:
ECHO 1 - Download one track 
ECHO 2 - Download all liked songs by a SC user
ECHO 3 - Download all songs posted by SC user
ECHO 4 - Download all posted, and liked songs by SC user
ECHO 5 - EXIT

:: the choice command

set pass=
choice /c 12345 /n /m ""
set pass=%errorlevel%

:: the choices

if errorlevel 1 set goto=1
if errorlevel 2 set goto=2
if errorlevel 3 set goto=3
if errorlevel 4 set goto=4
if errorlevel 5 set goto=exit
goto %goto%

pause
cls


:1
cls
for /f "delims=: tokens=*" %%A in ('findstr /b ::: "%~f0"') do @echo(%%A
Echo .
ECHO YOUR DOWNLOAD PATH WILL BEGIN FROM %cd%. 
ECHO Open Batch in desired folder to change path.
Echo .
set /p URL=Paste the exact track URL Here: 
IF [%URL%] == [] GOTO start
scdl -l %URL% --min-size "500k" --extract-artist --addtofile --download-archive archive.txt -c
ECHO You must face your enemies without the tools you've come to rely on. 
pause
cls
goto 1


:2
cls
for /f "delims=: tokens=*" %%A in ('findstr /b ::: "%~f0"') do @echo(%%A
Echo .
ECHO YOUR DOWNLOAD PATH WILL BEGIN FROM %cd%. 
ECHO Open Batch in desired folder to change path.
Echo .
set /p URL=Paste the SoundCloud User URL Here: 
IF [%URL%] == [] GOTO start
scdl -l %URL% --min-size "500k" --extract-artist --addtofile --download-archive archive.txt -f -c
ECHO You must face your enemies without the tools you've come to rely on. 
pause
goto all-likes

:3
cls
for /f "delims=: tokens=*" %%A in ('findstr /b ::: "%~f0"') do @echo(%%A
Echo .
ECHO YOUR DOWNLOAD PATH WILL BEGIN FROM %cd%. 
ECHO Open Batch in desired folder to change path.
Echo .
set /p URL=Paste the SoundCloud User URL Here: 
IF [%URL%] == [] GOTO start
scdl -l %URL% --min-size "500k" --extract-artist --addtofile --download-archive archive.txt -t -c
ECHO You must face your enemies without the tools you've come to rely on. 
pause
cls
goto 3

:4
cls
for /f "delims=: tokens=*" %%A in ('findstr /b ::: "%~f0"') do @echo(%%A
Echo .
ECHO YOUR DOWNLOAD PATH WILL BEGIN FROM %cd%. 
ECHO Open Batch in desired folder to change path.
Echo .
set /p URL=Paste the SoundCloud User URL Here:
IF [%URL%] == [] GOTO start 
scdl -l %URL% --min-size "500k" --extract-artist --addtofile --download-archive archive.txt -m -c
ECHO You must face your enemies without the tools you've come to rely on. 
pause
cls
goto 4



:exit
exit
:::
:::            @@@@@@@@@@@@@@@@@@@@@@@@@@@@        
:::       @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
:::      @@@@@@@@SOUNDCLOUD DOWNLOADER@@@@@@@@@@@@
:::    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
:::   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
:::   @@@@@@@@@@@@@@  '.@@@@@@@@@@@@@@@@@.--.@@@@@@@@@
:::     @@@@@@@@\   @@  ¯ @@@@@@@@@@@ '¯¯ ___..@@@@@@
:::      @@@@@@@@|                 @    .'@@@@@@@@@@
:::         @@@@@@\                    /@@@@@@@@
:::                \                  /
:::                |   .--'|__|'--.   |
:::                |  /.--'/  \'--.\  |
:::    __  ___     /      /____\      \     ___
:::  _(  )(   )_  |     .' .''. '.     |  _(   )__  __      __
::: (           )_|    |__/    \__|    |_(        )(  )_   (
:::              /                      \__             )_(¯
::: _______.---./    .'       COPY          \_.--._ ___________
:::   --''¯        _/    __  PASTA                '--..       
:::              ''    .'   THE URL AND PRESS ENTER BELOW!!!
:::This trial shall test your courage to ensure you are worthy of this splendor.
Nice drawing :D
Kaliados wrote:
24 Nov 2018 13:46
When I came back to refining the code I ran into a bit of a wall that I am just baffled on, and would like some outside aide.
Any edit I do to the script breaks the code.
Can you isolate the problem and show me what you change that breaks the code and the output ? Taking out all the code I don't need to test, like scdl etcetera. Can you size it down a bit and show the problem using only 4 lines of code ?

Post Reply