This commit is contained in:
cangui 2025-06-19 21:21:17 +02:00
parent 6aaa2f6e42
commit 9cfa861bb9
2 changed files with 7 additions and 7 deletions

View File

@ -157,7 +157,7 @@ func (c *Client) RequestDeviceCodeWithCredentials(ctx context.Context, username,
form.Set("grant_type", "password") // possible variation
form.Set("username", username)
form.Set("password", password)
form.Set("scope", "get.post.downloader get.post.seedbox get.account")
form.Set("scope", "get.post.downloader get.post.seedbox get.account get.post.stream")
req, err := http.NewRequestWithContext(ctx, http.MethodPost, "https://debrid-link.com/api/oauth/device/code", strings.NewReader(form.Encode()))
if err != nil {

View File

@ -311,11 +311,11 @@ func HandleAddJob(db *gorm.DB) http.HandlerFunc {
for _, l := range links {
log.Printf("[l'id] : %v\n", l.ID)
// streamInfo, err := client.CreateTranscode(ctx,l.ID)
// if err != nil {
// log.Println("Erreur GetTranscode:", err)
// return
// }
streamInfo, err := client.CreateTranscode(ctx,l.ID)
if err != nil {
log.Println("Erreur GetTranscode:", err)
return
}
job := &download.DownloadJob{
ID: l.ID,
@ -326,7 +326,7 @@ func HandleAddJob(db *gorm.DB) http.HandlerFunc {
Size: l.Size,
Host: l.Host,
Progress: 0, // obligatoire si valeur attendue
StreamURL: "", // vide par défaut
StreamURL: streamInfo.StreamURL, // vide par défaut
}
if err := download.RegisterJobWithDB(job, db); err != nil {
log.Printf("[ERROR] Job non enregistré : %v\n", err)