nichobi / sponsorblockcast

A shell script that skips sponsored YouTube content on all local Chromecasts
GNU General Public License v3.0
348 stars 15 forks source link

Check for existance of $id before skipping #13

Closed MrYadro closed 3 years ago

MrYadro commented 3 years ago

Somewhere around here should be check if id is provided: https://github.com/nichobi/sponsorblockcast/blob/main/sponsorblockcast.sh#L17 some videos or TV's not returning video id and script goes to api with empty id https://sponsor.ajay.app/api/skipSegments?videoID=

[
  {
    "category": "sponsor",
    "segment": [
      176.84334,
      247.31374
    ],
    "UUID": "35496c0d681a66920329413e855f7781d05b64e1a9ce30c18049fc0720bd221f",
    "videoDuration": 0
  },
  {
    "category": "sponsor",
    "segment": [
      1271,
      1361
    ],
    "UUID": "8f4e3c846e685f49f4e9ce328e5b6245d17968ce92c8129904c44d12c80b0df5",
    "videoDuration": 0
  },
  {
    "category": "sponsor",
    "segment": [
      2084,
      2240
    ],
    "UUID": "e2a9c7786aa4ac930181ea02652363067f2ac1e9a7c7cdde7e08de6c953e39d9",
    "videoDuration": 0
  }
]

And every video without an id now skipping some parts of it.