From 5bb48b25017353dbb605aa257c2e76fdcfc5962f Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 15 Dec 2022 07:49:47 +0000 Subject: [PATCH] generate.js: remove dbg for addPreview, add detailed avc1 declarations, remove vague avc1 lint warning --- generate.js | 63 ++++++++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 32 deletions(-) diff --git a/generate.js b/generate.js index 4f45688..b1654a4 100755 --- a/generate.js +++ b/generate.js @@ -80,7 +80,7 @@ RadioSource.prototype.addPreview = function () { type = arguments[1] codecs = arguments[2] size = arguments[3] - displayType = "n" + displayType = arguments[4] } else if (typeof arguments[0] == "string" && typeof arguments[1] == "string" && typeof arguments[2] == "string") { uri = arguments[0] type = arguments[1] @@ -195,27 +195,27 @@ const mediaItems = [ .addPreview("mxc://glowers.club/FJfFhscJavurBvoEuRbykpmM", "image/jpg", "500x500")), RadioItem.new("dobson") - .addSource(RadioSource.new("video/mp4", [ "avc1", "mp4a.40.2" ]) + .addSource(RadioSource.new("video/mp4", [ "avc1.64000D", "mp4a.40.2" ]) .setURI("mxc://glowers.club/mRtnfcoHYkyAOXSkYvrnbZgX") .addPreview("mxc://glowers.club/eHKVfIITgdRKERhVOPSTDQAc", "image/jpg", "432x426")), // FIXME: Original audio source found, not remix source or video source RadioItem.new("poljacked") .setMetadata("BLACK BLADE", "Seyit Akbas", "https://youtu.be/6RnNXLZ2rfw", "1.15%, pitched up") - .addSource(RadioSource.new("video/mp4", [ "avc1", "mp4a.40.2" ]) + .addSource(RadioSource.new("video/mp4", [ "avc1.64001E", "mp4a.40.2" ]) .setURI("mxc://glowers.club/stlNnyEIUVGluyhpPSGhtjJg") .addPreview("mxc://glowers.club/BczfFtojBhwMxTNjoZfhemam", "image/jpg", "638x360") - .addPreview("mxc://glowers.club/wVLvTOIodRqOcasDAFxkqHaG", "video/mp4", [ "avc1" ], "358x360", EDisplayType.SQUARE) + .addPreview("mxc://glowers.club/wVLvTOIodRqOcasDAFxkqHaG", "video/mp4", [ "avc1.4D401F" ], "358x360", EDisplayType.SQUARE) .addPreview("mxc://glowers.club/EBQRprvJmkNfsZTzCzDkPVTv", "image/gif", "320x320", EDisplayType.SQUARE)) .addSource(RadioSource.new("video/webm", [ "vp8", "vorbis" ]) .setURI("mxc://glowers.club/xnYQdrroEheIZBfigHGZferu") .addPreview("mxc://glowers.club/BczfFtojBhwMxTNjoZfhemam", "image/jpg", "638x360") - .addPreview("mxc://glowers.club/wVLvTOIodRqOcasDAFxkqHaG", "video/mp4", [ "avc1" ], "358x360", EDisplayType.SQUARE) + .addPreview("mxc://glowers.club/wVLvTOIodRqOcasDAFxkqHaG", "video/mp4", [ "avc1.4D401F" ], "358x360", EDisplayType.SQUARE) .addPreview("mxc://glowers.club/EBQRprvJmkNfsZTzCzDkPVTv", "image/gif", "320x320", EDisplayType.SQUARE)), RadioItem.new("femalecops") .addTags([ "misc" ]) - .addSource(RadioSource.new("video/mp4", [ "avc1", "mp4a.40.2" ]) + .addSource(RadioSource.new("video/mp4", [ "avc1.64001F", "mp4a.40.2" ]) .setURI("mxc://glowers.club/ZSyUyEGvOLOoUaqFVoCYPTif") .addPreview("mxc://glowers.club/BVQhXkWSYbvFcSerzVZFgfrn", "image/jpg", "600x600")) .addSource(RadioSource.new("video/webm", [ "vp9", "opus" ]) @@ -224,10 +224,10 @@ const mediaItems = [ RadioItem.new("autisticclowns") .addTags([ "misc" ]) - .addSource(RadioSource.new("video/mp4", [ "avc1", "mp4a.40.2" ]) + .addSource(RadioSource.new("video/mp4", [ "avc1.640015", "mp4a.40.2" ]) .setURI("mxc://glowers.club/fGszYTUkpyWsKuxphzJSfAZk") .addPreview("mxc://glowers.club/esDPBgpoTvTtqekHAQJRwqtK", "image/jpg", "480x272")) - .addSource(RadioSource.new("video/quicktime", [ "avc1", "mp4a.40.2" ]) + .addSource(RadioSource.new("video/quicktime", [ "avc1.4D0015", "mp4a.40.2" ]) .setURI("mxc://glowers.club/WqYtubpqVplLjSxxmaxNeQir") .addPreview("mxc://glowers.club/esDPBgpoTvTtqekHAQJRwqtK", "image/jpg", "480x272")), @@ -236,7 +236,7 @@ const mediaItems = [ .addSource(RadioSource.new("video/webm", [ "vp9", "opus" ]) .setURI("mxc://glowers.club/abgQasVrghOSkpRZTIfHMFyF") .addPreview("mxc://glowers.club/IhivpcDssjnjSDHBdMEGGwVp", "image/jpg", "320x180")) - .addSource(RadioSource.new("video/mp4", [ "avc1", "mp4a.40.2" ]) + .addSource(RadioSource.new("video/mp4", [ "avc1.4D401F", "mp4a.40.2" ]) .setURI("mxc://glowers.club/ieQlfAlPPGeXLsvevolcQKqO") .addPreview("mxc://glowers.club/IhivpcDssjnjSDHBdMEGGwVp", "image/jpg", "320x180")), @@ -248,13 +248,13 @@ const mediaItems = [ RadioItem.new("hyperborea") .setMetadata("Somebody That I Used to Know", "VelvetCasca") - .addSource(RadioSource.new("video/mp4", [ "avc1", "mp4a.40.2" ]) + .addSource(RadioSource.new("video/mp4", [ "avc1.4D401F", "mp4a.40.2" ]) .setURI("mxc://glowers.club/egAyPBuGNFPYyvnMWMxySLiX") .addPreview("mxc://glowers.club/dOxJvUWRlGqRRxJdpDRZyeko", "image/jpg", "640x360")), RadioItem.new("feizhou") .setMetadata("Without the Communist Party, There Would Be No New China", "Brother Hao", "https://youtu.be/5tCMI0uKbBE") - .addSource(RadioSource.new("video/mp4", [ "avc1", "mp4a.40.2" ]) + .addSource(RadioSource.new("video/mp4", [ "avc1.42C015", "mp4a.40.2" ]) .setURI("mxc://glowers.club/fVKJZgWpIHRmilhZLboFXOIK") .addPreview("mxc://glowers.club/EuYQZnqLjRGPMocgqGqtKFpJ", "image/jpg", "366x240")) .addSource(RadioSource.new("video/webm", [ "vp8", "vorbis" ]) @@ -263,7 +263,7 @@ const mediaItems = [ RadioItem.new("breathe") .setMetadata("Breathe (in the Air)", "Pink Floyd") - .addSource(RadioSource.new("video/mp4", [ "avc1", "mp4a.40.2" ]) + .addSource(RadioSource.new("video/mp4", [ "avc1.64001E", "mp4a.40.2" ]) .setURI("mxc://glowers.club/MOyzIHtapiyrpxaYRoiQqMqf") .addPreview("mxc://glowers.club/KytvUDmLWCFKQWwHemdDTksd", "image/jpg", "640x360")) .addSource(RadioSource.new("video/webm", [ "vp8", "vorbis" ]) @@ -304,7 +304,7 @@ const mediaItems = [ RadioItem.new("thisistheinfowar") .setMetadata("In the House, In a Heartbeat", "John Murphy") .addTags([ "metadata-prefer-id" ]) - .addSource(RadioSource.new("video/mp4", [ "avc1", "mp4a.40.2" ]) + .addSource(RadioSource.new("video/mp4", [ "avc1.64001E", "mp4a.40.2" ]) .setURI("mxc://glowers.club/HVZUugkUhbJEPDncuTpAnOfh") .addPreview("mxc://glowers.club/klXuXEwYNmYvsZhNOaXsDGJq", "image/jpg", "640x360")) .addSource(RadioSource.new("video/webm", [ "vp8", "vorbis" ]) @@ -314,17 +314,17 @@ const mediaItems = [ RadioItem.new("floyd") .setMetadata("Paralyzer", "Finger Seven") .addTags([ "misc" ]) - .addSource(RadioSource.new("video/mp4", [ "avc1", "mp4a.40.2" ]) + .addSource(RadioSource.new("video/mp4", [ "avc1.640020", "mp4a.40.2" ]) .setURI("mxc://glowers.club/qtBuqQBqBrpyusCsWYXlgmtE") .addPreview("mxc://glowers.club/JjsGuJkEGAbudLaYvbAcxryQ", "image/jpg", "600x600")) - .addSource(RadioSource.new("video/quicktime", [ "avc1", "mp4a.40.2" ]) + .addSource(RadioSource.new("video/quicktime", [ "avc1.640020", "mp4a.40.2" ]) .setURI("mxc://glowers.club/IusHmBCOyJZFGHxsGjRkYqXf") .addPreview("mxc://glowers.club/JjsGuJkEGAbudLaYvbAcxryQ", "image/jpg", "600x600")), RadioItem.new("amd") .setMetadata("Svetovid", "Jan Janko Močnik") .addTags([ "misc" ]) - .addSource(RadioSource.new("video/mp4", [ "avc1", "mp4a.40.2" ]) + .addSource(RadioSource.new("video/mp4", [ "avc1.64001F", "mp4a.40.2" ]) .setURI("mxc://glowers.club/wgQPrdTCUUTnKgpnwDVlEakc") .addPreview("mxc://glowers.club/GccquMupQGvDXYNeifUbxfuy", "image/jpg", "800x450")) .addSource(RadioSource.new("video/webm", [ "vp8", "vorbis" ]) @@ -340,7 +340,7 @@ const mediaItems = [ RadioItem.new("honorary") .setMetadata("Erika", "Major Han Friess") .addTags([ "metadata-prefer-id" ]) - .addSource(RadioSource.new("video/mp4", [ "avc1", "mp4a.40.2" ]) + .addSource(RadioSource.new("video/mp4", [ "avc1.64001E", "mp4a.40.2" ]) .setURI("mxc://glowers.club/cQgzwWXtxDSqqOlwGZYShVXS") .addPreview("mxc://glowers.club/aENkwWEKXIztqyBTJrBHCmRQ", "image/jpg", "800x450")) .addSource(RadioSource.new("video/webm", [ "vp8", "vorbis" ]) @@ -376,7 +376,7 @@ const mediaItems = [ RadioItem.new("negromancy") .setMetadata(undefined, undefined, "https://youtu.be/PxjA-jq1e7E") .addTags([ "misc" ]) - .addSource(RadioSource.new("video/mp4", [ "avc1", "mp4a.40.2" ]) + .addSource(RadioSource.new("video/mp4", [ "avc1.64001E", "mp4a.40.2" ]) .setURI("mxc://glowers.club/kYDmqwhymAidlTbdFHHliXrk") .addPreview("mxc://glowers.club/qAtvGoVERlYfFnNWeizoYiGP", "image/jpg", "640x360")) .addSource(RadioSource.new("video/webm", [ "vp9", "opus" ]) @@ -451,7 +451,7 @@ const mediaItems = [ RadioItem.new("GETOUTOFMYHEAD") .setMetadata("GETOUTOFMYHEAD", "placeboing", "https://youtu.be/Xnv38FnLkbM") .addTags([ "splash-song", "sus" ]) - .addSource(RadioSource.new("video/mp4", [ "avc1", "mp4a.40.2" ]) + .addSource(RadioSource.new("video/mp4", [ "avc1.4D401F", "mp4a.40.2" ]) .setURI("mxc://glowers.club/sEtheeOyZlztUtQuHOzOJpOk") .addPreview("mxc://glowers.club/bJveZSEIXFsnEKdjDvwmmENo", "image/jpg", "800x450")), @@ -472,7 +472,7 @@ const mediaItems = [ .setMetadata("Gangster Party Line", "Brent Weinbach", "https://youtu.be/Cx1J2CzNnS8") .setNiggadata("hotline", undefined) .addTags([ "misc" ]) - .addSource(RadioSource.new("video/mp4", [ "avc1", "mp4a.40.2" ]) + .addSource(RadioSource.new("video/mp4", [ "avc1.4D401F", "mp4a.40.2" ]) .setURI("mxc://glowers.club/gnZElBwskTnBXkeZPiINVtSB") .addPreview("mxc://glowers.club/iPoGcvVbhmElZgaZuEdNQDBJ", "image/jpg", "480x356")), @@ -506,13 +506,13 @@ const mediaItems = [ RadioItem.new("ywnbaw") .setMetadata("Professor proves SICKS are the best weapons", "Shadiversity", "https://youtu.be/mPnscZFUuog") .addTags([ "misc", "metadata-prefer-id" ]) - .addSource(RadioSource.new("video/mp4", [ "avc1", "mp4a.40.2" ]) + .addSource(RadioSource.new("video/mp4", [ "avc1.4D401F", "mp4a.40.2" ]) .setURI("mxc://glowers.club/qYCbeFblMeBUMDZEiuBWuFnX") .addPreview("mxc://glowers.club/dDbuzhpAoewNQoKHCejeQqdk", "image/jpg", "800x450")), RadioItem.new("feedandseed") .addTags([ "misc" ]) - .addSource(RadioSource.new("video/mp4", [ "avc1", "mp4a.40.2" ]) + .addSource(RadioSource.new("video/mp4", [ "avc1.64001E", "mp4a.40.2" ]) .setURI("mxc://glowers.club/vsMepElCpNKFgLltczQRjxfJ") .addPreview("mxc://glowers.club/zUXbbLOCCxZoZDRIwVCzHFYC", "image/jpg", "654x480")), @@ -527,7 +527,7 @@ const mediaItems = [ .setMetadata("Alex Jones Remix: Renai Circulation", "Triple-Q", "https://youtu.be/ODZE5peUfWQ") .setNiggadata("alexjones", "5796ca3646f17bf005a01be3") .addTags([ "metadata-prefer-id" ]) - .addSource(RadioSource.new("video/mp4", [ "avc1", "mp4a.40.2" ]) + .addSource(RadioSource.new("video/mp4", [ "avc1.4D401F", "mp4a.40.2" ]) .setURI("mxc://glowers.club/vADMHcSVAzikHdjSRXKsmllx") .addPreview("mxc://glowers.club/igLcLQjIYWSzTCRAPDMxSAmh", "image/jpg", "853x480") .addPreview("mxc://glowers.club/dcqgSxtEyYBQNpYLfpXkxADL", "image/jpg", "500x500", EDisplayType.SQUARE)), @@ -540,13 +540,13 @@ const mediaItems = [ RadioItem.new("thelinuxexperience") .addTags([ "misc" ]) - .addSource(RadioSource.new("video/mp4", [ "avc1", "mp4a.40.2" ]) + .addSource(RadioSource.new("video/mp4", [ "avc1.64001F", "mp4a.40.2" ]) .setURI("mxc://glowers.club/kzIdHQbGtQIdEitOruQHrXnM") .addPreview("mxc://glowers.club/wKPEYlKdaZiSdCDbImBInvxm", "image/jpg", "936x558")), RadioItem.new("mywifesblackson") .setMetadata("My Wife's Black Son", "Morrakiu", "https://youtu.be/7NpfbX5coqA") - .addSource(RadioSource.new("video/mp4", [ "avc1", "mp4a.40.2" ]) + .addSource(RadioSource.new("video/mp4", [ "avc1.4D401F", "mp4a.40.2" ]) .setURI("mxc://glowers.club/aJsmUUQuUDQMVbtKfagCjFQi") .addPreview("mxc://glowers.club/JbyoUSTYQcQaLbEspdRcDhpM", "image/jpg", "936x558")) .addSource(RadioSource.new("audio/mp3", [ "mp3" ]) @@ -586,7 +586,7 @@ const mediaItems = [ RadioItem.new("indialexjones") .setMetadata("INDIALEX JONES", "LENNOZ", "https://youtu.be/Vhzzt4SK7zw") - .addSource(RadioSource.new("video/mp4", [ "avc1", "mp4a.40.2" ]) + .addSource(RadioSource.new("video/mp4", [ "avc1.4D401F", "mp4a.40.2" ]) .setURI("mxc://glowers.club/abqGBuacMfwsfTBBONIyPpGt") .addPreview("mxc://glowers.club/ScZuHjnVjYmIWYTuoTMsYnPh", "image/jpg", "853x480") .addPreview("mxc://glowers.club/GiGkhVoVXtPHWYXrTICNDOho", "image/jpg", "500x500", EDisplayType.SQUARE)) @@ -678,7 +678,7 @@ const mediaItems = [ RadioItem.new("piebotnik") .setMetadata("dr robotnik bakes a pie", "KnightOfGames", "https://youtu.be/jqKVLZ9wA24") - .addSource(RadioSource.new("video/mp4", [ "avc1", "mp4a.40.2" ]) + .addSource(RadioSource.new("video/mp4", [ "avc1.4D4028", "mp4a.40.2" ]) .setURI("mxc://glowers.club/YUjleEpsnUnjnQPscgAzVPzX") .addPreview("mxc://glowers.club/jJqCgRDjBVfCHfWzkNnFXuyF", "image/jpg", "800x450") .addPreview("mxc://glowers.club/ZGGXHgsznHoqVrHotiPzpoGq", "image/jpg", "500x500", EDisplayType.SQUARE)) @@ -688,22 +688,21 @@ const mediaItems = [ RadioItem.new("donarudo") .setMetadata("【ドナルド】もうランランルーしか聞こえない【東方】※立体視可能", "Hoshi-Kun", "https://www.nicovideo.jp/watch/sm3179171") - .addSource(RadioSource.new("video/mp4", [ "avc1", "mp4a.40.2" ]) + .addSource(RadioSource.new("video/mp4", [ "avc1.4D4029", "mp4a.40.2" ]) .setURI("mxc://glowers.club/XNhgwibiPmHJARjWafsNhSlq", "v") .addPreview("mxc://glowers.club/XwEnNcCEcufMhpmDzxJARYgY", "image/jpg", "853x480") - .addPreview("mxc://glowers.club/NBCRNrPnlJmUwiyCTAvKKkzd", "video/mp4", [ "avc1" ], "384x384", EDisplayType.SQUARE) + .addPreview("mxc://glowers.club/NBCRNrPnlJmUwiyCTAvKKkzd", "video/mp4", [ "avc1.4D4029" ], "384x384", EDisplayType.SQUARE) .addPreview("mxc://glowers.club/WBuCuaxhOHahCzgSHrDBnyrV", "image/gif", "384x384", EDisplayType.SQUARE)) .addSource(RadioSource.new("audio/mp3", [ "mp3" ]) .setURI("mxc://glowers.club/CIfeVQBVYpBqZRxdVVJWfNJf") - .addPreview("mxc://glowers.club/NBCRNrPnlJmUwiyCTAvKKkzd", "video/mp4", [ "avc1" ], "384x384", EDisplayType.SQUARE) + .addPreview("mxc://glowers.club/NBCRNrPnlJmUwiyCTAvKKkzd", "video/mp4", [ "avc1.4D4029" ], "384x384", EDisplayType.SQUARE) .addPreview("mxc://glowers.club/WBuCuaxhOHahCzgSHrDBnyrV", "image/gif", "384x384", EDisplayType.SQUARE)) ].filter(Boolean).map(a => a.serialize()).sort((a,b) => a.id.localeCompare(b.id)) const lintCodecWarnings = { "video/mp4": [ - // Silence avc1 vagueness warnings for now - //[ "warn", "avc1", "vague, however browsers will accept it. See MDN for format details" ], + [ "warn", "avc1", "vague, however browsers will accept it. See MDN for format details" ], [ "error", "mp4a", "too vague; Browsers will not accept it! See MDN for format details" ], [ "error", "aac", "invalid! The correct codec is mp4a. See MDN for format details" ] ]