#42 Upload fail on peertube when there is only one tag

Kapalı
LecygneNoir tarafından 4 yıl önce açıldı · 3 yorum
LecygneNoir 4 yıl önce yorum yaptı
Sahibi

Hello,

A bug was found by @Zykino , when uploading a video to Peertube, if there is only one tag, the upload fail whith an error 400

Error from Peertube logs is:

  "path": "/api/v1/videos/upload",
  "err": {
    "tags": {
      "value": "Factory Builder",
      "msg": "Should have correct tags",
      "param": "tags",
      "location": "body"
    }
  }
}

If we add any other tags (eg something like "Factory Builder, test") it works.

If we upload the video through the web interface with only one tags, it also works.

Note sure at the moment if this is a prismedia or Peertube's API bug, I'll need to dig it.

To reproduce:

 ./prismedia_upload.py --file="file.mp4"  -t "Factory Builder" --platform=peertube
Hello, A bug was found by @Zykino , when uploading a video to Peertube, if there is only one tag, the upload fail whith an error 400 Error from Peertube logs is: ``` "path": "/api/v1/videos/upload", "err": { "tags": { "value": "Factory Builder", "msg": "Should have correct tags", "param": "tags", "location": "body" } } } ``` If we add any other tags (eg something like `"Factory Builder, test"`) it works. If we upload the video through the web interface with only one tags, it also works. Note sure at the moment if this is a prismedia or Peertube's API bug, I'll need to dig it. To reproduce: ``` ./prismedia_upload.py --file="file.mp4" -t "Factory Builder" --platform=peertube ```
LecygneNoir
bug
4 yıl önce etiketini ekledi
Zykino 4 yıl önce yorum yaptı
Poster

Following the official doc there should be between 1 and 5 items in an array. According to the log you provided there "value" is a string instead.

I suppose this https://git.lecygnenoir.info/LecygneNoir/prismedia/src/tag/v0.7.0/lib/pt_upload.py#L207 create a string at first and then an array if we add more tag. I do not know how to fix it right now.

Following the [official doc](https://docs.joinpeertube.org/api-rest-reference.html#tag/Video/paths/~1videos~1upload/post) there should be between 1 and 5 items in an *array*. According to the log you provided there `"value"` is a string instead. I suppose this https://git.lecygnenoir.info/LecygneNoir/prismedia/src/tag/v0.7.0/lib/pt_upload.py#L207 create a string at first and then an array if we add more tag. I do not know how to fix it right now.
LecygneNoir 4 yıl önce yorum yaptı
Poster
Sahibi

Great catch!

It's indeed probably that. I'll dig the library to see how to create an array at first round.

Thanks!

Great catch! It's indeed probably that. I'll dig the library to see how to create an array at first round. Thanks!
LecygneNoir 4 yıl önce yorum yaptı
Poster
Sahibi

Solved by 5dc6c78211

Solved by https://git.lecygnenoir.info/LecygneNoir/prismedia/commit/5dc6c782117c3d04e5098a5cd00191ee3de2a51b
LecygneNoir 4 yıl önce konusunu kapattı
Bu konuşmaya katılmak için oturum aç.
Kilometre Taşı Yok
Atanan Kişi Yok
2 Katılımcı
Bildirimler
Bitiş Tarihi

Bitiş tarihi atanmadı.

Bağımlılıklar

Bu konu henüz bir bağımlılık içermiyor.

Yükleniyor…
Henüz bir içerik yok.