@@ -125,7 +125,6 @@ const DownloadDialog: FC<Props> = ({ open, onClose, onDownloadStart }) => {
|
|||||||
* Retrive url from input and display the formats selection view
|
* Retrive url from input and display the formats selection view
|
||||||
*/
|
*/
|
||||||
const sendUrlFormatSelection = () => {
|
const sendUrlFormatSelection = () => {
|
||||||
setUrl('')
|
|
||||||
setPickedAudioFormat('')
|
setPickedAudioFormat('')
|
||||||
setPickedVideoFormat('')
|
setPickedVideoFormat('')
|
||||||
setPickedBestFormat('')
|
setPickedBestFormat('')
|
||||||
|
|||||||
@@ -222,7 +222,7 @@ func (p *Process) Kill() error {
|
|||||||
|
|
||||||
// Returns the available format for this URL
|
// Returns the available format for this URL
|
||||||
// TODO: Move out from process.go
|
// TODO: Move out from process.go
|
||||||
func (p *Process) GetFormatsSync() (DownloadFormats, error) {
|
func (p *Process) GetFormats() (DownloadFormats, error) {
|
||||||
cmd := exec.Command(config.Instance().DownloaderPath, p.Url, "-J")
|
cmd := exec.Command(config.Instance().DownloaderPath, p.Url, "-J")
|
||||||
|
|
||||||
stdout, err := cmd.Output()
|
stdout, err := cmd.Output()
|
||||||
@@ -257,7 +257,6 @@ func (p *Process) GetFormatsSync() (DownloadFormats, error) {
|
|||||||
decodingError = json.Unmarshal(stdout, &info)
|
decodingError = json.Unmarshal(stdout, &info)
|
||||||
wg.Done()
|
wg.Done()
|
||||||
}()
|
}()
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
decodingError = json.Unmarshal(stdout, &best)
|
decodingError = json.Unmarshal(stdout, &best)
|
||||||
wg.Done()
|
wg.Done()
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ func (s *Service) Formats(args Args, meta *internal.DownloadFormats) error {
|
|||||||
err error
|
err error
|
||||||
p = internal.Process{Url: args.URL, Logger: s.logger}
|
p = internal.Process{Url: args.URL, Logger: s.logger}
|
||||||
)
|
)
|
||||||
*meta, err = p.GetFormatsSync()
|
*meta, err = p.GetFormats()
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user