Task issue

Post

Posted
Rating:
#1 (In Topic #899)
Avatar
Guru
cogier is in the usergroup ‘Guru’
I can use a shell command without issue: -

Code (gambas)

  1. Public sUrl As String = "https://www.youtube.com/watch?v=Gu9sqZZOiR0&t=66s"
  2.  
  3. Public Sub Form_Open()
  4.  
  5.   Shell "youtube-dl " & sUrl Wait ''This works
  6.  
I would like to do this in a Task but when I try I get 40+ error lines like this: -

Code

Traceback (most recent call last):
  File "/usr/bin/youtube-dl", line 33, in <module>
    sys.exit(load_entry_point('youtube-dl==2021.4.26', 'console_scripts', 'youtube-dl')())
  File "/usr/lib/python3/dist-packages/youtube_dl/__init__.py", line 479, in main
    _real_main(argv)....

Any ideas?

Sample program attached.
Attachment
Online now: No Back to the top

Post

Posted
Rating:
#2
Guru
BruceSteers is in the usergroup ‘Guru’
 Here ye go fella.

I guess like ffmpeg tools just using gambas shell is not enough.  You HAVE to use the Process pointer and use the Output/Input flags

I found with your command just using Output and not input gave me a download and not an error
also Shell failed and i had to use Exec


Have attached your example with the GetVideo task using the process pointer and using Process_Read event

Attachment
Online now: No Back to the top

Post

Posted
Rating:
#3
Guru
BruceSteers is in the usergroup ‘Guru’
 Note:
Using..
hProc = Exec ["youtube-dl", sUrl] For Input Output As "Process"

(with Input) it gave an error but it was the same error i got when the Shell command ran in Form_Open() in FMain startup so with Input Output it worked the same.
Online now: No Back to the top

Post

Posted
Rating:
#4
Avatar
Guru
cogier is in the usergroup ‘Guru’
Thanks, Bruce. This is now working as I expected.  :D
Online now: No Back to the top
1 guest and 0 members have just viewed this.