Third draft
This commit is contained in:
parent
1bd6d12276
commit
165fe82177
@ -29,34 +29,17 @@
|
|||||||
(cdr (assoc `preferred-video-codes defaults))
|
(cdr (assoc `preferred-video-codes defaults))
|
||||||
(cdr (assoc `preferred-audio-codes defaults)))
|
(cdr (assoc `preferred-audio-codes defaults)))
|
||||||
|
|
||||||
(define (fetch-formats port)
|
(define (lines-to-values port)
|
||||||
(define* (codes #:optional new-codes)
|
|
||||||
(if (procedure? codes)
|
|
||||||
"PROCEDURE"
|
|
||||||
(format #t "NOT PROCEDURE\nNEW-CODES: ~a\n" new-codes)))
|
|
||||||
|
|
||||||
(let* ((this-line (get-line port)))
|
(let* ((this-line (get-line port)))
|
||||||
|
|
||||||
(if (not (eof-object? this-line))
|
(if (not (eof-object? this-line))
|
||||||
(let ((video-match (match-video-format this-line))
|
(let ((video-match (match-video-format this-line))
|
||||||
(audio-match (match-audio-format this-line)))
|
(audio-match (match-audio-format this-line)))
|
||||||
|
(begin
|
||||||
(cond
|
(and audio-match (format #t "~a\n" audio-match))
|
||||||
(video-match
|
(and video-match (format #t "~a\n" video-match))
|
||||||
(let ((video-code (match:substring video-match 1))
|
(lines-to-values yt-dlp-port))))))
|
||||||
(video-resolution (match:substring video-match 2))
|
|
||||||
(video-moreinfo (match:substring video-match 3)))
|
|
||||||
(format #t "~a\n" video-code)))
|
|
||||||
(audio-match
|
|
||||||
(let ((audio-code (match:substring audio-match 1))
|
|
||||||
(audio-moreinfo (match:substring audio-match 2)))
|
|
||||||
(format #t "~a\n" audio-code))))
|
|
||||||
(fetch-formats port))
|
|
||||||
(codes))))
|
|
||||||
|
|
||||||
;;(define (format-codes ytdl-formats)
|
|
||||||
|
|
||||||
|
|
||||||
;; Main
|
;; Main
|
||||||
(format #t "~a\n" (fetch-formats yt-dlp-port))
|
(lines-to-values yt-dlp-port)
|
||||||
(close-port yt-dlp-port)
|
(close-port yt-dlp-port)
|
||||||
|
Loading…
Reference in New Issue
Block a user