aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.vscode/settings.json13
-rw-r--r--build-server.hxml3
-rw-r--r--build/server.js1518
-rw-r--r--hxformat.json2
-rw-r--r--res/client.js115
-rw-r--r--src/Types.hx6
-rw-r--r--src/client/Main.hx12
-rw-r--r--src/client/Player.hx4
-rw-r--r--src/client/players/Youtube.hx69
-rw-r--r--src/server/HttpServer.hx24
-rw-r--r--src/server/Main.hx18
-rw-r--r--src/server/YoutubeFallback.hx144
-rw-r--r--src/utils/YoutubeUtils.hx83
13 files changed, 1530 insertions, 481 deletions
diff --git a/.vscode/settings.json b/.vscode/settings.json
index abef51a..6bb8af7 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -8,11 +8,12 @@
"res/client.js": true
},
"[haxe]": {
- "editor.formatOnSave": true,
- "editor.codeActionsOnSave": {
- "source.organizeImports": "explicit",
- "source.fixAll": "explicit"
- }
+ "editor.formatOnSave": true,
+ "editor.formatOnPaste": false
+ },
+ "editor.codeActionsOnSave": {
+ "source.sortImports": "explicit",
+ "source.fixAll": "explicit"
},
"[html]": {
"editor.formatOnSave": true,
@@ -20,6 +21,6 @@
},
"[css]": {
"editor.formatOnSave": true,
- "editor.defaultFormatter": "HookyQR.beautify"
+ "editor.defaultFormatter": "vscode.css-language-features"
},
}
diff --git a/build-server.hxml b/build-server.hxml
index 31baeed..25aa12c 100644
--- a/build-server.hxml
+++ b/build-server.hxml
@@ -1,6 +1,7 @@
--library hxnodejs
--library hxnodejs-ws
---library json2object
+--library json2object:git:https://github.com/RblSb/json2object.git
+-D junsafe_compiler_cache
# Client libs for completion
--library youtubeIFramePlayer:git:https://github.com/okawa-h/youtubeIFramePlayer-externs.git
--library hls.js-extern:git:https://github.com/grosmar/hls.js-haxe-extern.git
diff --git a/build/server.js b/build/server.js
index d2836d6..301f7d7 100644
--- a/build/server.js
+++ b/build/server.js
@@ -507,7 +507,7 @@ JsonParser_$1.__name__ = true;
JsonParser_$1.__super__ = json2object_reader_BaseParser;
JsonParser_$1.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
- this.errors.push(json2object_Error.IncorrectType(variable,"{ ?updatePlaylist : Null<{ videoList : Array<VideoItem> }>, ?updateClients : Null<{ clients : Array<ClientData> }>, type : WsEventType, ?togglePlaylistLock : Null<{ isOpen : Bool }>, ?toggleItemType : Null<{ pos : Int }>, ?skipVideo : Null<{ url : String }>, ?setTime : Null<{ time : Float }>, ?setRate : Null<{ rate : Float }>, ?setNextItem : Null<{ pos : Int }>, ?setLeader : Null<{ clientName : String }>, ?serverMessage : Null<{ textId : String }>, ?rewind : Null<{ time : Float }>, ?removeVideo : Null<{ url : String }>, ?playItem : Null<{ pos : Int }>, ?play : Null<{ time : Float }>, ?pause : Null<{ time : Float }>, ?message : Null<{ text : String, clientName : String }>, ?logout : Null<{ oldClientName : String, clients : Array<ClientData>, clientName : String }>, ?login : Null<{ ?passHash : Null<String>, ?isUnknownClient : Null<Bool>, ?clients : Null<Array<ClientData>>, clientName : String }>, ?kickClient : Null<{ name : String }>, ?getTime : Null<{ time : Float, ?rate : Null<Float>, ?paused : Null<Bool> }>, ?dump : Null<{ data : String }>, ?connected : Null<{ videoList : Array<VideoItem>, itemPos : Int, isUnknownClient : Bool, isPlaylistOpen : Bool, history : Array<Message>, globalIp : String, config : Config, clients : Array<ClientData>, clientName : String }>, ?banClient : Null<{ time : Float, name : String }>, ?addVideo : Null<{ item : VideoItem, atEnd : Bool }> }",pos));
+ this.errors.push(json2object_Error.IncorrectType(variable,"{ ?updatePlaylist : Null<{ videoList : Array<VideoItem> }>, ?updateClients : Null<{ clients : Array<ClientData> }>, type : WsEventType, ?togglePlaylistLock : Null<{ isOpen : Bool }>, ?toggleItemType : Null<{ pos : Int }>, ?skipVideo : Null<{ url : String }>, ?setTime : Null<{ time : Float }>, ?setRate : Null<{ rate : Float }>, ?setNextItem : Null<{ pos : Int }>, ?setLeader : Null<{ clientName : String }>, ?serverMessage : Null<{ textId : String }>, ?rewind : Null<{ time : Float }>, ?removeVideo : Null<{ url : String }>, ?playItem : Null<{ pos : Int }>, ?play : Null<{ time : Float }>, ?pause : Null<{ time : Float }>, ?message : Null<{ text : String, clientName : String }>, ?logout : Null<{ oldClientName : String, clients : Array<ClientData>, clientName : String }>, ?login : Null<{ ?passHash : Null<String>, ?isUnknownClient : Null<Bool>, ?clients : Null<Array<ClientData>>, clientName : String }>, ?kickClient : Null<{ name : String }>, ?getYoutubeVideoInfo : Null<{ url : String, ?response : Null<utils.YouTubeVideoInfo> }>, ?getTime : Null<{ time : Float, ?rate : Null<Float>, ?paused : Null<Bool> }>, ?dump : Null<{ data : String }>, ?connected : Null<{ videoList : Array<VideoItem>, itemPos : Int, isUnknownClient : Bool, isPlaylistOpen : Bool, history : Array<Message>, globalIp : String, config : Config, clients : Array<ClientData>, clientName : String }>, ?banClient : Null<{ time : Float, name : String }>, ?addVideo : Null<{ item : VideoItem, atEnd : Bool }> }",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
}
,loadJsonNull: function(pos,variable) {
@@ -515,7 +515,7 @@ JsonParser_$1.prototype = $extend(json2object_reader_BaseParser.prototype,{
}
,loadJsonObject: function(o,pos,variable) {
var assigned = new haxe_ds_StringMap();
- this.objectSetupAssign(assigned,["addVideo","banClient","connected","dump","getTime","kickClient","login","logout","message","pause","play","playItem","removeVideo","rewind","serverMessage","setLeader","setNextItem","setRate","setTime","skipVideo","toggleItemType","togglePlaylistLock","type","updateClients","updatePlaylist"],[true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,true,true]);
+ this.objectSetupAssign(assigned,["addVideo","banClient","connected","dump","getTime","getYoutubeVideoInfo","kickClient","login","logout","message","pause","play","playItem","removeVideo","rewind","serverMessage","setLeader","setNextItem","setRate","setTime","skipVideo","toggleItemType","togglePlaylistLock","type","updateClients","updatePlaylist"],[true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,true,true]);
this.value = this.getAuto();
var _g = 0;
while(_g < o.length) {
@@ -537,65 +537,68 @@ JsonParser_$1.prototype = $extend(json2object_reader_BaseParser.prototype,{
case "getTime":
this.value.getTime = this.loadObjectField(($_=new JsonParser_$11(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"getTime",assigned,this.value.getTime,pos);
break;
+ case "getYoutubeVideoInfo":
+ this.value.getYoutubeVideoInfo = this.loadObjectField(($_=new JsonParser_$13(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"getYoutubeVideoInfo",assigned,this.value.getYoutubeVideoInfo,pos);
+ break;
case "kickClient":
- this.value.kickClient = this.loadObjectField(($_=new JsonParser_$13(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"kickClient",assigned,this.value.kickClient,pos);
+ this.value.kickClient = this.loadObjectField(($_=new JsonParser_$15(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"kickClient",assigned,this.value.kickClient,pos);
break;
case "login":
- this.value.login = this.loadObjectField(($_=new JsonParser_$15(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"login",assigned,this.value.login,pos);
+ this.value.login = this.loadObjectField(($_=new JsonParser_$17(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"login",assigned,this.value.login,pos);
break;
case "logout":
- this.value.logout = this.loadObjectField(($_=new JsonParser_$17(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"logout",assigned,this.value.logout,pos);
+ this.value.logout = this.loadObjectField(($_=new JsonParser_$19(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"logout",assigned,this.value.logout,pos);
break;
case "message":
- this.value.message = this.loadObjectField(($_=new JsonParser_$19(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"message",assigned,this.value.message,pos);
+ this.value.message = this.loadObjectField(($_=new JsonParser_$21(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"message",assigned,this.value.message,pos);
break;
case "pause":
- this.value.pause = this.loadObjectField(($_=new JsonParser_$21(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"pause",assigned,this.value.pause,pos);
+ this.value.pause = this.loadObjectField(($_=new JsonParser_$23(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"pause",assigned,this.value.pause,pos);
break;
case "play":
- this.value.play = this.loadObjectField(($_=new JsonParser_$21(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"play",assigned,this.value.play,pos);
+ this.value.play = this.loadObjectField(($_=new JsonParser_$23(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"play",assigned,this.value.play,pos);
break;
case "playItem":
- this.value.playItem = this.loadObjectField(($_=new JsonParser_$23(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"playItem",assigned,this.value.playItem,pos);
+ this.value.playItem = this.loadObjectField(($_=new JsonParser_$25(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"playItem",assigned,this.value.playItem,pos);
break;
case "removeVideo":
- this.value.removeVideo = this.loadObjectField(($_=new JsonParser_$25(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"removeVideo",assigned,this.value.removeVideo,pos);
+ this.value.removeVideo = this.loadObjectField(($_=new JsonParser_$27(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"removeVideo",assigned,this.value.removeVideo,pos);
break;
case "rewind":
- this.value.rewind = this.loadObjectField(($_=new JsonParser_$21(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"rewind",assigned,this.value.rewind,pos);
+ this.value.rewind = this.loadObjectField(($_=new JsonParser_$23(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"rewind",assigned,this.value.rewind,pos);
break;
case "serverMessage":
- this.value.serverMessage = this.loadObjectField(($_=new JsonParser_$27(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"serverMessage",assigned,this.value.serverMessage,pos);
+ this.value.serverMessage = this.loadObjectField(($_=new JsonParser_$29(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"serverMessage",assigned,this.value.serverMessage,pos);
break;
case "setLeader":
- this.value.setLeader = this.loadObjectField(($_=new JsonParser_$29(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"setLeader",assigned,this.value.setLeader,pos);
+ this.value.setLeader = this.loadObjectField(($_=new JsonParser_$31(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"setLeader",assigned,this.value.setLeader,pos);
break;
case "setNextItem":
- this.value.setNextItem = this.loadObjectField(($_=new JsonParser_$23(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"setNextItem",assigned,this.value.setNextItem,pos);
+ this.value.setNextItem = this.loadObjectField(($_=new JsonParser_$25(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"setNextItem",assigned,this.value.setNextItem,pos);
break;
case "setRate":
- this.value.setRate = this.loadObjectField(($_=new JsonParser_$31(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"setRate",assigned,this.value.setRate,pos);
+ this.value.setRate = this.loadObjectField(($_=new JsonParser_$33(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"setRate",assigned,this.value.setRate,pos);
break;
case "setTime":
- this.value.setTime = this.loadObjectField(($_=new JsonParser_$21(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"setTime",assigned,this.value.setTime,pos);
+ this.value.setTime = this.loadObjectField(($_=new JsonParser_$23(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"setTime",assigned,this.value.setTime,pos);
break;
case "skipVideo":
- this.value.skipVideo = this.loadObjectField(($_=new JsonParser_$25(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"skipVideo",assigned,this.value.skipVideo,pos);
+ this.value.skipVideo = this.loadObjectField(($_=new JsonParser_$27(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"skipVideo",assigned,this.value.skipVideo,pos);
break;
case "toggleItemType":
- this.value.toggleItemType = this.loadObjectField(($_=new JsonParser_$23(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"toggleItemType",assigned,this.value.toggleItemType,pos);
+ this.value.toggleItemType = this.loadObjectField(($_=new JsonParser_$25(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"toggleItemType",assigned,this.value.toggleItemType,pos);
break;
case "togglePlaylistLock":
- this.value.togglePlaylistLock = this.loadObjectField(($_=new JsonParser_$33(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"togglePlaylistLock",assigned,this.value.togglePlaylistLock,pos);
+ this.value.togglePlaylistLock = this.loadObjectField(($_=new JsonParser_$35(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"togglePlaylistLock",assigned,this.value.togglePlaylistLock,pos);
break;
case "type":
- this.value.type = this.loadObjectField(($_=new JsonParser_$34(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"type",assigned,this.value.type,pos);
+ this.value.type = this.loadObjectField(($_=new JsonParser_$36(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"type",assigned,this.value.type,pos);
break;
case "updateClients":
- this.value.updateClients = this.loadObjectField(($_=new JsonParser_$36(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"updateClients",assigned,this.value.updateClients,pos);
+ this.value.updateClients = this.loadObjectField(($_=new JsonParser_$38(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"updateClients",assigned,this.value.updateClients,pos);
break;
case "updatePlaylist":
- this.value.updatePlaylist = this.loadObjectField(($_=new JsonParser_$38(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"updatePlaylist",assigned,this.value.updatePlaylist,pos);
+ this.value.updatePlaylist = this.loadObjectField(($_=new JsonParser_$40(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"updatePlaylist",assigned,this.value.updatePlaylist,pos);
break;
default:
this.errors.push(json2object_Error.UnknownVariable(field.name,this.putils.convertPosition(field.namePos)));
@@ -604,7 +607,7 @@ JsonParser_$1.prototype = $extend(json2object_reader_BaseParser.prototype,{
this.objectErrors(assigned,pos);
}
,getAuto: function() {
- return { addVideo : new JsonParser_$3([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), banClient : new JsonParser_$5([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), connected : new JsonParser_$7([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), dump : new JsonParser_$9([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), getTime : new JsonParser_$11([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), kickClient : new JsonParser_$13([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), login : new JsonParser_$15([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), logout : new JsonParser_$17([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), message : new JsonParser_$19([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), pause : new JsonParser_$21([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), play : new JsonParser_$21([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), playItem : new JsonParser_$23([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), removeVideo : new JsonParser_$25([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), rewind : new JsonParser_$21([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), serverMessage : new JsonParser_$27([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), setLeader : new JsonParser_$29([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), setNextItem : new JsonParser_$23([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), setRate : new JsonParser_$31([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), setTime : new JsonParser_$21([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), skipVideo : new JsonParser_$25([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), toggleItemType : new JsonParser_$23([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), togglePlaylistLock : new JsonParser_$33([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), type : new JsonParser_$34([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), updateClients : new JsonParser_$36([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), updatePlaylist : new JsonParser_$38([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
+ return { addVideo : new JsonParser_$3([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), banClient : new JsonParser_$5([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), connected : new JsonParser_$7([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), dump : new JsonParser_$9([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), getTime : new JsonParser_$11([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), getYoutubeVideoInfo : new JsonParser_$13([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), kickClient : new JsonParser_$15([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), login : new JsonParser_$17([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), logout : new JsonParser_$19([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), message : new JsonParser_$21([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), pause : new JsonParser_$23([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), play : new JsonParser_$23([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), playItem : new JsonParser_$25([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), removeVideo : new JsonParser_$27([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), rewind : new JsonParser_$23([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), serverMessage : new JsonParser_$29([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), setLeader : new JsonParser_$31([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), setNextItem : new JsonParser_$25([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), setRate : new JsonParser_$33([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), setTime : new JsonParser_$23([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), skipVideo : new JsonParser_$27([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), toggleItemType : new JsonParser_$25([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), togglePlaylistLock : new JsonParser_$35([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), type : new JsonParser_$36([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), updateClients : new JsonParser_$38([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), updatePlaylist : new JsonParser_$40([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
}
,__class__: JsonParser_$1
});
@@ -634,13 +637,13 @@ JsonParser_$11.prototype = $extend(json2object_reader_BaseParser.prototype,{
++_g;
switch(field.name) {
case "paused":
- this.value.paused = this.loadObjectField(($_=new JsonParser_$54(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"paused",assigned,this.value.paused,pos);
+ this.value.paused = this.loadObjectField(($_=new JsonParser_$56(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"paused",assigned,this.value.paused,pos);
break;
case "rate":
- this.value.rate = this.loadObjectField(($_=new JsonParser_$56(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"rate",assigned,this.value.rate,pos);
+ this.value.rate = this.loadObjectField(($_=new JsonParser_$79(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"rate",assigned,this.value.rate,pos);
break;
case "time":
- this.value.time = this.loadObjectField(($_=new JsonParser_$43(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"time",assigned,this.value.time,pos);
+ this.value.time = this.loadObjectField(($_=new JsonParser_$45(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"time",assigned,this.value.time,pos);
break;
default:
this.errors.push(json2object_Error.UnknownVariable(field.name,this.putils.convertPosition(field.namePos)));
@@ -649,7 +652,7 @@ JsonParser_$11.prototype = $extend(json2object_reader_BaseParser.prototype,{
this.objectErrors(assigned,pos);
}
,getAuto: function() {
- return { paused : new JsonParser_$54([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), rate : new JsonParser_$56([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), time : new JsonParser_$43([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
+ return { paused : new JsonParser_$56([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), rate : new JsonParser_$79([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), time : new JsonParser_$45([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
}
,__class__: JsonParser_$11
});
@@ -663,7 +666,7 @@ JsonParser_$13.__name__ = true;
JsonParser_$13.__super__ = json2object_reader_BaseParser;
JsonParser_$13.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
- this.errors.push(json2object_Error.IncorrectType(variable,"{ name : String }",pos));
+ this.errors.push(json2object_Error.IncorrectType(variable,"{ url : String, ?response : Null<utils.YouTubeVideoInfo> }",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
}
,loadJsonNull: function(pos,variable) {
@@ -671,22 +674,27 @@ JsonParser_$13.prototype = $extend(json2object_reader_BaseParser.prototype,{
}
,loadJsonObject: function(o,pos,variable) {
var assigned = new haxe_ds_StringMap();
- this.objectSetupAssign(assigned,["name"],[false]);
+ this.objectSetupAssign(assigned,["response","url"],[true,false]);
this.value = this.getAuto();
var _g = 0;
while(_g < o.length) {
var field = o[_g];
++_g;
- if(field.name == "name") {
- this.value.name = this.loadObjectField(($_=new JsonParser_$42(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"name",assigned,this.value.name,pos);
- } else {
+ switch(field.name) {
+ case "response":
+ this.value.response = this.loadObjectField(($_=new JsonParser_$59(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"response",assigned,this.value.response,pos);
+ break;
+ case "url":
+ this.value.url = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"url",assigned,this.value.url,pos);
+ break;
+ default:
this.errors.push(json2object_Error.UnknownVariable(field.name,this.putils.convertPosition(field.namePos)));
}
}
this.objectErrors(assigned,pos);
}
,getAuto: function() {
- return { name : new JsonParser_$42([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
+ return { response : new JsonParser_$59([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), url : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
}
,__class__: JsonParser_$13
});
@@ -700,7 +708,7 @@ JsonParser_$15.__name__ = true;
JsonParser_$15.__super__ = json2object_reader_BaseParser;
JsonParser_$15.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
- this.errors.push(json2object_Error.IncorrectType(variable,"{ ?passHash : Null<String>, ?isUnknownClient : Null<Bool>, ?clients : Null<Array<ClientData>>, clientName : String }",pos));
+ this.errors.push(json2object_Error.IncorrectType(variable,"{ name : String }",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
}
,loadJsonNull: function(pos,variable) {
@@ -708,33 +716,22 @@ JsonParser_$15.prototype = $extend(json2object_reader_BaseParser.prototype,{
}
,loadJsonObject: function(o,pos,variable) {
var assigned = new haxe_ds_StringMap();
- this.objectSetupAssign(assigned,["clientName","clients","isUnknownClient","passHash"],[false,true,true,true]);
+ this.objectSetupAssign(assigned,["name"],[false]);
this.value = this.getAuto();
var _g = 0;
while(_g < o.length) {
var field = o[_g];
++_g;
- switch(field.name) {
- case "clientName":
- this.value.clientName = this.loadObjectField(($_=new JsonParser_$42(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"clientName",assigned,this.value.clientName,pos);
- break;
- case "clients":
- this.value.clients = this.loadObjectField(($_=new JsonParser_$52(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"clients",assigned,this.value.clients,pos);
- break;
- case "isUnknownClient":
- this.value.isUnknownClient = this.loadObjectField(($_=new JsonParser_$54(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"isUnknownClient",assigned,this.value.isUnknownClient,pos);
- break;
- case "passHash":
- this.value.passHash = this.loadObjectField(($_=new JsonParser_$46(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"passHash",assigned,this.value.passHash,pos);
- break;
- default:
+ if(field.name == "name") {
+ this.value.name = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"name",assigned,this.value.name,pos);
+ } else {
this.errors.push(json2object_Error.UnknownVariable(field.name,this.putils.convertPosition(field.namePos)));
}
}
this.objectErrors(assigned,pos);
}
,getAuto: function() {
- return { clientName : new JsonParser_$42([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), clients : new JsonParser_$52([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), isUnknownClient : new JsonParser_$54([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), passHash : new JsonParser_$46([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
+ return { name : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
}
,__class__: JsonParser_$15
});
@@ -748,7 +745,7 @@ JsonParser_$17.__name__ = true;
JsonParser_$17.__super__ = json2object_reader_BaseParser;
JsonParser_$17.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
- this.errors.push(json2object_Error.IncorrectType(variable,"{ oldClientName : String, clients : Array<ClientData>, clientName : String }",pos));
+ this.errors.push(json2object_Error.IncorrectType(variable,"{ ?passHash : Null<String>, ?isUnknownClient : Null<Bool>, ?clients : Null<Array<ClientData>>, clientName : String }",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
}
,loadJsonNull: function(pos,variable) {
@@ -756,7 +753,7 @@ JsonParser_$17.prototype = $extend(json2object_reader_BaseParser.prototype,{
}
,loadJsonObject: function(o,pos,variable) {
var assigned = new haxe_ds_StringMap();
- this.objectSetupAssign(assigned,["clientName","clients","oldClientName"],[false,false,false]);
+ this.objectSetupAssign(assigned,["clientName","clients","isUnknownClient","passHash"],[false,true,true,true]);
this.value = this.getAuto();
var _g = 0;
while(_g < o.length) {
@@ -764,13 +761,16 @@ JsonParser_$17.prototype = $extend(json2object_reader_BaseParser.prototype,{
++_g;
switch(field.name) {
case "clientName":
- this.value.clientName = this.loadObjectField(($_=new JsonParser_$42(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"clientName",assigned,this.value.clientName,pos);
+ this.value.clientName = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"clientName",assigned,this.value.clientName,pos);
break;
case "clients":
- this.value.clients = this.loadObjectField(($_=new JsonParser_$47(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"clients",assigned,this.value.clients,pos);
+ this.value.clients = this.loadObjectField(($_=new JsonParser_$54(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"clients",assigned,this.value.clients,pos);
break;
- case "oldClientName":
- this.value.oldClientName = this.loadObjectField(($_=new JsonParser_$42(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"oldClientName",assigned,this.value.oldClientName,pos);
+ case "isUnknownClient":
+ this.value.isUnknownClient = this.loadObjectField(($_=new JsonParser_$56(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"isUnknownClient",assigned,this.value.isUnknownClient,pos);
+ break;
+ case "passHash":
+ this.value.passHash = this.loadObjectField(($_=new JsonParser_$48(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"passHash",assigned,this.value.passHash,pos);
break;
default:
this.errors.push(json2object_Error.UnknownVariable(field.name,this.putils.convertPosition(field.namePos)));
@@ -779,7 +779,7 @@ JsonParser_$17.prototype = $extend(json2object_reader_BaseParser.prototype,{
this.objectErrors(assigned,pos);
}
,getAuto: function() {
- return { clientName : new JsonParser_$42([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), clients : new JsonParser_$47([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), oldClientName : new JsonParser_$42([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
+ return { clientName : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), clients : new JsonParser_$54([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), isUnknownClient : new JsonParser_$56([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), passHash : new JsonParser_$48([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
}
,__class__: JsonParser_$17
});
@@ -793,7 +793,7 @@ JsonParser_$19.__name__ = true;
JsonParser_$19.__super__ = json2object_reader_BaseParser;
JsonParser_$19.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
- this.errors.push(json2object_Error.IncorrectType(variable,"{ text : String, clientName : String }",pos));
+ this.errors.push(json2object_Error.IncorrectType(variable,"{ oldClientName : String, clients : Array<ClientData>, clientName : String }",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
}
,loadJsonNull: function(pos,variable) {
@@ -801,7 +801,7 @@ JsonParser_$19.prototype = $extend(json2object_reader_BaseParser.prototype,{
}
,loadJsonObject: function(o,pos,variable) {
var assigned = new haxe_ds_StringMap();
- this.objectSetupAssign(assigned,["clientName","text"],[false,false]);
+ this.objectSetupAssign(assigned,["clientName","clients","oldClientName"],[false,false,false]);
this.value = this.getAuto();
var _g = 0;
while(_g < o.length) {
@@ -809,10 +809,13 @@ JsonParser_$19.prototype = $extend(json2object_reader_BaseParser.prototype,{
++_g;
switch(field.name) {
case "clientName":
- this.value.clientName = this.loadObjectField(($_=new JsonParser_$42(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"clientName",assigned,this.value.clientName,pos);
+ this.value.clientName = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"clientName",assigned,this.value.clientName,pos);
break;
- case "text":
- this.value.text = this.loadObjectField(($_=new JsonParser_$42(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"text",assigned,this.value.text,pos);
+ case "clients":
+ this.value.clients = this.loadObjectField(($_=new JsonParser_$49(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"clients",assigned,this.value.clients,pos);
+ break;
+ case "oldClientName":
+ this.value.oldClientName = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"oldClientName",assigned,this.value.oldClientName,pos);
break;
default:
this.errors.push(json2object_Error.UnknownVariable(field.name,this.putils.convertPosition(field.namePos)));
@@ -821,7 +824,7 @@ JsonParser_$19.prototype = $extend(json2object_reader_BaseParser.prototype,{
this.objectErrors(assigned,pos);
}
,getAuto: function() {
- return { clientName : new JsonParser_$42([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), text : new JsonParser_$42([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
+ return { clientName : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), clients : new JsonParser_$49([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), oldClientName : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
}
,__class__: JsonParser_$19
});
@@ -835,7 +838,7 @@ JsonParser_$21.__name__ = true;
JsonParser_$21.__super__ = json2object_reader_BaseParser;
JsonParser_$21.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
- this.errors.push(json2object_Error.IncorrectType(variable,"{ time : Float }",pos));
+ this.errors.push(json2object_Error.IncorrectType(variable,"{ text : String, clientName : String }",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
}
,loadJsonNull: function(pos,variable) {
@@ -843,22 +846,27 @@ JsonParser_$21.prototype = $extend(json2object_reader_BaseParser.prototype,{
}
,loadJsonObject: function(o,pos,variable) {
var assigned = new haxe_ds_StringMap();
- this.objectSetupAssign(assigned,["time"],[false]);
+ this.objectSetupAssign(assigned,["clientName","text"],[false,false]);
this.value = this.getAuto();
var _g = 0;
while(_g < o.length) {
var field = o[_g];
++_g;
- if(field.name == "time") {
- this.value.time = this.loadObjectField(($_=new JsonParser_$43(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"time",assigned,this.value.time,pos);
- } else {
+ switch(field.name) {
+ case "clientName":
+ this.value.clientName = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"clientName",assigned,this.value.clientName,pos);
+ break;
+ case "text":
+ this.value.text = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"text",assigned,this.value.text,pos);
+ break;
+ default:
this.errors.push(json2object_Error.UnknownVariable(field.name,this.putils.convertPosition(field.namePos)));
}
}
this.objectErrors(assigned,pos);
}
,getAuto: function() {
- return { time : new JsonParser_$43([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
+ return { clientName : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), text : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
}
,__class__: JsonParser_$21
});
@@ -872,7 +880,7 @@ JsonParser_$23.__name__ = true;
JsonParser_$23.__super__ = json2object_reader_BaseParser;
JsonParser_$23.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
- this.errors.push(json2object_Error.IncorrectType(variable,"{ pos : Int }",pos));
+ this.errors.push(json2object_Error.IncorrectType(variable,"{ time : Float }",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
}
,loadJsonNull: function(pos,variable) {
@@ -880,14 +888,14 @@ JsonParser_$23.prototype = $extend(json2object_reader_BaseParser.prototype,{
}
,loadJsonObject: function(o,pos,variable) {
var assigned = new haxe_ds_StringMap();
- this.objectSetupAssign(assigned,["pos"],[false]);
+ this.objectSetupAssign(assigned,["time"],[false]);
this.value = this.getAuto();
var _g = 0;
while(_g < o.length) {
var field = o[_g];
++_g;
- if(field.name == "pos") {
- this.value.pos = this.loadObjectField(($_=new JsonParser_$50(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"pos",assigned,this.value.pos,pos);
+ if(field.name == "time") {
+ this.value.time = this.loadObjectField(($_=new JsonParser_$45(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"time",assigned,this.value.time,pos);
} else {
this.errors.push(json2object_Error.UnknownVariable(field.name,this.putils.convertPosition(field.namePos)));
}
@@ -895,7 +903,7 @@ JsonParser_$23.prototype = $extend(json2object_reader_BaseParser.prototype,{
this.objectErrors(assigned,pos);
}
,getAuto: function() {
- return { pos : new JsonParser_$50([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
+ return { time : new JsonParser_$45([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
}
,__class__: JsonParser_$23
});
@@ -909,7 +917,7 @@ JsonParser_$25.__name__ = true;
JsonParser_$25.__super__ = json2object_reader_BaseParser;
JsonParser_$25.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
- this.errors.push(json2object_Error.IncorrectType(variable,"{ url : String }",pos));
+ this.errors.push(json2object_Error.IncorrectType(variable,"{ pos : Int }",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
}
,loadJsonNull: function(pos,variable) {
@@ -917,14 +925,14 @@ JsonParser_$25.prototype = $extend(json2object_reader_BaseParser.prototype,{
}
,loadJsonObject: function(o,pos,variable) {
var assigned = new haxe_ds_StringMap();
- this.objectSetupAssign(assigned,["url"],[false]);
+ this.objectSetupAssign(assigned,["pos"],[false]);
this.value = this.getAuto();
var _g = 0;
while(_g < o.length) {
var field = o[_g];
++_g;
- if(field.name == "url") {
- this.value.url = this.loadObjectField(($_=new JsonParser_$42(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"url",assigned,this.value.url,pos);
+ if(field.name == "pos") {
+ this.value.pos = this.loadObjectField(($_=new JsonParser_$52(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"pos",assigned,this.value.pos,pos);
} else {
this.errors.push(json2object_Error.UnknownVariable(field.name,this.putils.convertPosition(field.namePos)));
}
@@ -932,7 +940,7 @@ JsonParser_$25.prototype = $extend(json2object_reader_BaseParser.prototype,{
this.objectErrors(assigned,pos);
}
,getAuto: function() {
- return { url : new JsonParser_$42([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
+ return { pos : new JsonParser_$52([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
}
,__class__: JsonParser_$25
});
@@ -946,7 +954,7 @@ JsonParser_$27.__name__ = true;
JsonParser_$27.__super__ = json2object_reader_BaseParser;
JsonParser_$27.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
- this.errors.push(json2object_Error.IncorrectType(variable,"{ textId : String }",pos));
+ this.errors.push(json2object_Error.IncorrectType(variable,"{ url : String }",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
}
,loadJsonNull: function(pos,variable) {
@@ -954,14 +962,14 @@ JsonParser_$27.prototype = $extend(json2object_reader_BaseParser.prototype,{
}
,loadJsonObject: function(o,pos,variable) {
var assigned = new haxe_ds_StringMap();
- this.objectSetupAssign(assigned,["textId"],[false]);
+ this.objectSetupAssign(assigned,["url"],[false]);
this.value = this.getAuto();
var _g = 0;
while(_g < o.length) {
var field = o[_g];
++_g;
- if(field.name == "textId") {
- this.value.textId = this.loadObjectField(($_=new JsonParser_$42(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"textId",assigned,this.value.textId,pos);
+ if(field.name == "url") {
+ this.value.url = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"url",assigned,this.value.url,pos);
} else {
this.errors.push(json2object_Error.UnknownVariable(field.name,this.putils.convertPosition(field.namePos)));
}
@@ -969,7 +977,7 @@ JsonParser_$27.prototype = $extend(json2object_reader_BaseParser.prototype,{
this.objectErrors(assigned,pos);
}
,getAuto: function() {
- return { textId : new JsonParser_$42([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
+ return { url : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
}
,__class__: JsonParser_$27
});
@@ -983,7 +991,7 @@ JsonParser_$29.__name__ = true;
JsonParser_$29.__super__ = json2object_reader_BaseParser;
JsonParser_$29.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
- this.errors.push(json2object_Error.IncorrectType(variable,"{ clientName : String }",pos));
+ this.errors.push(json2object_Error.IncorrectType(variable,"{ textId : String }",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
}
,loadJsonNull: function(pos,variable) {
@@ -991,14 +999,14 @@ JsonParser_$29.prototype = $extend(json2object_reader_BaseParser.prototype,{
}
,loadJsonObject: function(o,pos,variable) {
var assigned = new haxe_ds_StringMap();
- this.objectSetupAssign(assigned,["clientName"],[false]);
+ this.objectSetupAssign(assigned,["textId"],[false]);
this.value = this.getAuto();
var _g = 0;
while(_g < o.length) {
var field = o[_g];
++_g;
- if(field.name == "clientName") {
- this.value.clientName = this.loadObjectField(($_=new JsonParser_$42(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"clientName",assigned,this.value.clientName,pos);
+ if(field.name == "textId") {
+ this.value.textId = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"textId",assigned,this.value.textId,pos);
} else {
this.errors.push(json2object_Error.UnknownVariable(field.name,this.putils.convertPosition(field.namePos)));
}
@@ -1006,7 +1014,7 @@ JsonParser_$29.prototype = $extend(json2object_reader_BaseParser.prototype,{
this.objectErrors(assigned,pos);
}
,getAuto: function() {
- return { clientName : new JsonParser_$42([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
+ return { textId : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
}
,__class__: JsonParser_$29
});
@@ -1036,10 +1044,10 @@ JsonParser_$3.prototype = $extend(json2object_reader_BaseParser.prototype,{
++_g;
switch(field.name) {
case "atEnd":
- this.value.atEnd = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"atEnd",assigned,this.value.atEnd,pos);
+ this.value.atEnd = this.loadObjectField(($_=new JsonParser_$46(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"atEnd",assigned,this.value.atEnd,pos);
break;
case "item":
- this.value.item = this.loadObjectField(($_=new JsonParser_$41(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"item",assigned,this.value.item,pos);
+ this.value.item = this.loadObjectField(($_=new JsonParser_$43(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"item",assigned,this.value.item,pos);
break;
default:
this.errors.push(json2object_Error.UnknownVariable(field.name,this.putils.convertPosition(field.namePos)));
@@ -1048,7 +1056,7 @@ JsonParser_$3.prototype = $extend(json2object_reader_BaseParser.prototype,{
this.objectErrors(assigned,pos);
}
,getAuto: function() {
- return { atEnd : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), item : new JsonParser_$41([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
+ return { atEnd : new JsonParser_$46([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), item : new JsonParser_$43([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
}
,__class__: JsonParser_$3
});
@@ -1062,7 +1070,7 @@ JsonParser_$31.__name__ = true;
JsonParser_$31.__super__ = json2object_reader_BaseParser;
JsonParser_$31.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
- this.errors.push(json2object_Error.IncorrectType(variable,"{ rate : Float }",pos));
+ this.errors.push(json2object_Error.IncorrectType(variable,"{ clientName : String }",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
}
,loadJsonNull: function(pos,variable) {
@@ -1070,14 +1078,14 @@ JsonParser_$31.prototype = $extend(json2object_reader_BaseParser.prototype,{
}
,loadJsonObject: function(o,pos,variable) {
var assigned = new haxe_ds_StringMap();
- this.objectSetupAssign(assigned,["rate"],[false]);
+ this.objectSetupAssign(assigned,["clientName"],[false]);
this.value = this.getAuto();
var _g = 0;
while(_g < o.length) {
var field = o[_g];
++_g;
- if(field.name == "rate") {
- this.value.rate = this.loadObjectField(($_=new JsonParser_$43(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"rate",assigned,this.value.rate,pos);
+ if(field.name == "clientName") {
+ this.value.clientName = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"clientName",assigned,this.value.clientName,pos);
} else {
this.errors.push(json2object_Error.UnknownVariable(field.name,this.putils.convertPosition(field.namePos)));
}
@@ -1085,7 +1093,7 @@ JsonParser_$31.prototype = $extend(json2object_reader_BaseParser.prototype,{
this.objectErrors(assigned,pos);
}
,getAuto: function() {
- return { rate : new JsonParser_$43([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
+ return { clientName : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
}
,__class__: JsonParser_$31
});
@@ -1099,6 +1107,43 @@ JsonParser_$33.__name__ = true;
JsonParser_$33.__super__ = json2object_reader_BaseParser;
JsonParser_$33.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
+ this.errors.push(json2object_Error.IncorrectType(variable,"{ rate : Float }",pos));
+ json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
+ }
+ ,loadJsonNull: function(pos,variable) {
+ this.value = null;
+ }
+ ,loadJsonObject: function(o,pos,variable) {
+ var assigned = new haxe_ds_StringMap();
+ this.objectSetupAssign(assigned,["rate"],[false]);
+ this.value = this.getAuto();
+ var _g = 0;
+ while(_g < o.length) {
+ var field = o[_g];
+ ++_g;
+ if(field.name == "rate") {
+ this.value.rate = this.loadObjectField(($_=new JsonParser_$45(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"rate",assigned,this.value.rate,pos);
+ } else {
+ this.errors.push(json2object_Error.UnknownVariable(field.name,this.putils.convertPosition(field.namePos)));
+ }
+ }
+ this.objectErrors(assigned,pos);
+ }
+ ,getAuto: function() {
+ return { rate : new JsonParser_$45([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
+ }
+ ,__class__: JsonParser_$33
+});
+var JsonParser_$35 = function(errors,putils,errorType) {
+ if(errorType == null) {
+ errorType = 0;
+ }
+ json2object_reader_BaseParser.call(this,errors,putils,errorType);
+};
+JsonParser_$35.__name__ = true;
+JsonParser_$35.__super__ = json2object_reader_BaseParser;
+JsonParser_$35.prototype = $extend(json2object_reader_BaseParser.prototype,{
+ onIncorrectType: function(pos,variable) {
this.errors.push(json2object_Error.IncorrectType(variable,"{ isOpen : Bool }",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
}
@@ -1114,7 +1159,7 @@ JsonParser_$33.prototype = $extend(json2object_reader_BaseParser.prototype,{
var field = o[_g];
++_g;
if(field.name == "isOpen") {
- this.value.isOpen = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"isOpen",assigned,this.value.isOpen,pos);
+ this.value.isOpen = this.loadObjectField(($_=new JsonParser_$46(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"isOpen",assigned,this.value.isOpen,pos);
} else {
this.errors.push(json2object_Error.UnknownVariable(field.name,this.putils.convertPosition(field.namePos)));
}
@@ -1122,19 +1167,19 @@ JsonParser_$33.prototype = $extend(json2object_reader_BaseParser.prototype,{
this.objectErrors(assigned,pos);
}
,getAuto: function() {
- return { isOpen : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
+ return { isOpen : new JsonParser_$46([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
}
- ,__class__: JsonParser_$33
+ ,__class__: JsonParser_$35
});
-var JsonParser_$34 = function(errors,putils,errorType) {
+var JsonParser_$36 = function(errors,putils,errorType) {
if(errorType == null) {
errorType = 0;
}
json2object_reader_BaseParser.call(this,errors,putils,errorType);
};
-JsonParser_$34.__name__ = true;
-JsonParser_$34.__super__ = json2object_reader_BaseParser;
-JsonParser_$34.prototype = $extend(json2object_reader_BaseParser.prototype,{
+JsonParser_$36.__name__ = true;
+JsonParser_$36.__super__ = json2object_reader_BaseParser;
+JsonParser_$36.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
this.value = "Connected";
this.errors.push(json2object_Error.IncorrectType(variable,"WsEventType",pos));
@@ -1144,19 +1189,19 @@ JsonParser_$34.prototype = $extend(json2object_reader_BaseParser.prototype,{
this.value = null;
}
,loadJsonString: function(s,pos,variable) {
- this.value = this.loadString(s,pos,variable,["Connected","Disconnected","Login","PasswordRequest","LoginError","Logout","Message","ServerMessage","UpdateClients","BanClient","KickClient","AddVideo","RemoveVideo","SkipVideo","VideoLoaded","Pause","Play","GetTime","SetTime","SetRate","Rewind","Flashback","SetLeader","PlayItem","SetNextItem","ToggleItemType","ClearChat","ClearPlaylist","ShufflePlaylist","UpdatePlaylist","TogglePlaylistLock","Dump"],"Connected");
+ this.value = this.loadString(s,pos,variable,["Connected","Disconnected","Login","PasswordRequest","LoginError","Logout","Message","ServerMessage","UpdateClients","BanClient","KickClient","AddVideo","RemoveVideo","SkipVideo","VideoLoaded","Pause","Play","GetTime","SetTime","SetRate","Rewind","Flashback","SetLeader","PlayItem","SetNextItem","ToggleItemType","ClearChat","ClearPlaylist","ShufflePlaylist","UpdatePlaylist","TogglePlaylistLock","Dump","GetYoutubeVideoInfo"],"Connected");
}
- ,__class__: JsonParser_$34
+ ,__class__: JsonParser_$36
});
-var JsonParser_$36 = function(errors,putils,errorType) {
+var JsonParser_$38 = function(errors,putils,errorType) {
if(errorType == null) {
errorType = 0;
}
json2object_reader_BaseParser.call(this,errors,putils,errorType);
};
-JsonParser_$36.__name__ = true;
-JsonParser_$36.__super__ = json2object_reader_BaseParser;
-JsonParser_$36.prototype = $extend(json2object_reader_BaseParser.prototype,{
+JsonParser_$38.__name__ = true;
+JsonParser_$38.__super__ = json2object_reader_BaseParser;
+JsonParser_$38.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
this.errors.push(json2object_Error.IncorrectType(variable,"{ clients : Array<ClientData> }",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
@@ -1173,7 +1218,7 @@ JsonParser_$36.prototype = $extend(json2object_reader_BaseParser.prototype,{
var field = o[_g];
++_g;
if(field.name == "clients") {
- this.value.clients = this.loadObjectField(($_=new JsonParser_$47(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"clients",assigned,this.value.clients,pos);
+ this.value.clients = this.loadObjectField(($_=new JsonParser_$49(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"clients",assigned,this.value.clients,pos);
} else {
this.errors.push(json2object_Error.UnknownVariable(field.name,this.putils.convertPosition(field.namePos)));
}
@@ -1181,19 +1226,19 @@ JsonParser_$36.prototype = $extend(json2object_reader_BaseParser.prototype,{
this.objectErrors(assigned,pos);
}
,getAuto: function() {
- return { clients : new JsonParser_$47([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
+ return { clients : new JsonParser_$49([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
}
- ,__class__: JsonParser_$36
+ ,__class__: JsonParser_$38
});
-var JsonParser_$38 = function(errors,putils,errorType) {
+var JsonParser_$40 = function(errors,putils,errorType) {
if(errorType == null) {
errorType = 0;
}
json2object_reader_BaseParser.call(this,errors,putils,errorType);
};
-JsonParser_$38.__name__ = true;
-JsonParser_$38.__super__ = json2object_reader_BaseParser;
-JsonParser_$38.prototype = $extend(json2object_reader_BaseParser.prototype,{
+JsonParser_$40.__name__ = true;
+JsonParser_$40.__super__ = json2object_reader_BaseParser;
+JsonParser_$40.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
this.errors.push(json2object_Error.IncorrectType(variable,"{ videoList : Array<VideoItem> }",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
@@ -1210,7 +1255,7 @@ JsonParser_$38.prototype = $extend(json2object_reader_BaseParser.prototype,{
var field = o[_g];
++_g;
if(field.name == "videoList") {
- this.value.videoList = this.loadObjectField(($_=new JsonParser_$39(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"videoList",assigned,this.value.videoList,pos);
+ this.value.videoList = this.loadObjectField(($_=new JsonParser_$41(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"videoList",assigned,this.value.videoList,pos);
} else {
this.errors.push(json2object_Error.UnknownVariable(field.name,this.putils.convertPosition(field.namePos)));
}
@@ -1218,19 +1263,19 @@ JsonParser_$38.prototype = $extend(json2object_reader_BaseParser.prototype,{
this.objectErrors(assigned,pos);
}
,getAuto: function() {
- return { videoList : new JsonParser_$39([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
+ return { videoList : new JsonParser_$41([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
}
- ,__class__: JsonParser_$38
+ ,__class__: JsonParser_$40
});
-var JsonParser_$39 = function(errors,putils,errorType) {
+var JsonParser_$41 = function(errors,putils,errorType) {
if(errorType == null) {
errorType = 0;
}
json2object_reader_BaseParser.call(this,errors,putils,errorType);
};
-JsonParser_$39.__name__ = true;
-JsonParser_$39.__super__ = json2object_reader_BaseParser;
-JsonParser_$39.prototype = $extend(json2object_reader_BaseParser.prototype,{
+JsonParser_$41.__name__ = true;
+JsonParser_$41.__super__ = json2object_reader_BaseParser;
+JsonParser_$41.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
this.errors.push(json2object_Error.IncorrectType(variable,"Array<VideoItem>",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
@@ -1239,19 +1284,19 @@ JsonParser_$39.prototype = $extend(json2object_reader_BaseParser.prototype,{
this.value = null;
}
,loadJsonArray: function(a,pos,variable) {
- this.value = this.loadJsonArrayValue(a,($_=new JsonParser_$41(this.errors,this.putils,2),$bind($_,$_.loadJson)),variable);
+ this.value = this.loadJsonArrayValue(a,($_=new JsonParser_$43(this.errors,this.putils,2),$bind($_,$_.loadJson)),variable);
}
- ,__class__: JsonParser_$39
+ ,__class__: JsonParser_$41
});
-var JsonParser_$41 = function(errors,putils,errorType) {
+var JsonParser_$43 = function(errors,putils,errorType) {
if(errorType == null) {
errorType = 0;
}
json2object_reader_BaseParser.call(this,errors,putils,errorType);
};
-JsonParser_$41.__name__ = true;
-JsonParser_$41.__super__ = json2object_reader_BaseParser;
-JsonParser_$41.prototype = $extend(json2object_reader_BaseParser.prototype,{
+JsonParser_$43.__name__ = true;
+JsonParser_$43.__super__ = json2object_reader_BaseParser;
+JsonParser_$43.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
this.errors.push(json2object_Error.IncorrectType(variable,"{ url : String, title : String, ?subs : Null<String>, isTemp : Bool, isIframe : Bool, duration : Float, author : String }",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
@@ -1269,25 +1314,25 @@ JsonParser_$41.prototype = $extend(json2object_reader_BaseParser.prototype,{
++_g;
switch(field.name) {
case "author":
- this.value.author = this.loadObjectField(($_=new JsonParser_$42(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"author",assigned,this.value.author,pos);
+ this.value.author = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"author",assigned,this.value.author,pos);
break;
case "duration":
- this.value.duration = this.loadObjectField(($_=new JsonParser_$43(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"duration",assigned,this.value.duration,pos);
+ this.value.duration = this.loadObjectField(($_=new JsonParser_$45(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"duration",assigned,this.value.duration,pos);
break;
case "isIframe":
- this.value.isIframe = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"isIframe",assigned,this.value.isIframe,pos);
+ this.value.isIframe = this.loadObjectField(($_=new JsonParser_$46(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"isIframe",assigned,this.value.isIframe,pos);
break;
case "isTemp":
- this.value.isTemp = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"isTemp",assigned,this.value.isTemp,pos);
+ this.value.isTemp = this.loadObjectField(($_=new JsonParser_$46(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"isTemp",assigned,this.value.isTemp,pos);
break;
case "subs":
- this.value.subs = this.loadObjectField(($_=new JsonParser_$46(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"subs",assigned,this.value.subs,pos);
+ this.value.subs = this.loadObjectField(($_=new JsonParser_$48(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"subs",assigned,this.value.subs,pos);
break;
case "title":
- this.value.title = this.loadObjectField(($_=new JsonParser_$42(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"title",assigned,this.value.title,pos);
+ this.value.title = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"title",assigned,this.value.title,pos);
break;
case "url":
- this.value.url = this.loadObjectField(($_=new JsonParser_$42(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"url",assigned,this.value.url,pos);
+ this.value.url = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"url",assigned,this.value.url,pos);
break;
default:
this.errors.push(json2object_Error.UnknownVariable(field.name,this.putils.convertPosition(field.namePos)));
@@ -1296,19 +1341,19 @@ JsonParser_$41.prototype = $extend(json2object_reader_BaseParser.prototype,{
this.objectErrors(assigned,pos);
}
,getAuto: function() {
- return { author : new JsonParser_$42([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), duration : new JsonParser_$43([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), isIframe : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), isTemp : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), subs : new JsonParser_$46([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), title : new JsonParser_$42([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), url : new JsonParser_$42([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
+ return { author : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), duration : new JsonParser_$45([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), isIframe : new JsonParser_$46([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), isTemp : new JsonParser_$46([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), subs : new JsonParser_$48([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), title : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), url : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
}
- ,__class__: JsonParser_$41
+ ,__class__: JsonParser_$43
});
-var JsonParser_$42 = function(errors,putils,errorType) {
+var JsonParser_$44 = function(errors,putils,errorType) {
if(errorType == null) {
errorType = 0;
}
json2object_reader_BaseParser.call(this,errors,putils,errorType);
};
-JsonParser_$42.__name__ = true;
-JsonParser_$42.__super__ = json2object_reader_BaseParser;
-JsonParser_$42.prototype = $extend(json2object_reader_BaseParser.prototype,{
+JsonParser_$44.__name__ = true;
+JsonParser_$44.__super__ = json2object_reader_BaseParser;
+JsonParser_$44.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
this.errors.push(json2object_Error.IncorrectType(variable,"String",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
@@ -1319,18 +1364,18 @@ JsonParser_$42.prototype = $extend(json2object_reader_BaseParser.prototype,{
,loadJsonString: function(s,pos,variable) {
this.value = s;
}
- ,__class__: JsonParser_$42
+ ,__class__: JsonParser_$44
});
-var JsonParser_$43 = function(errors,putils,errorType) {
+var JsonParser_$45 = function(errors,putils,errorType) {
if(errorType == null) {
errorType = 0;
}
json2object_reader_BaseParser.call(this,errors,putils,errorType);
this.value = 0;
};
-JsonParser_$43.__name__ = true;
-JsonParser_$43.__super__ = json2object_reader_BaseParser;
-JsonParser_$43.prototype = $extend(json2object_reader_BaseParser.prototype,{
+JsonParser_$45.__name__ = true;
+JsonParser_$45.__super__ = json2object_reader_BaseParser;
+JsonParser_$45.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
this.errors.push(json2object_Error.IncorrectType(variable,"Float",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
@@ -1338,18 +1383,18 @@ JsonParser_$43.prototype = $extend(json2object_reader_BaseParser.prototype,{
,loadJsonNumber: function(f,pos,variable) {
this.value = this.loadJsonFloat(f,pos,variable,this.value);
}
- ,__class__: JsonParser_$43
+ ,__class__: JsonParser_$45
});
-var JsonParser_$44 = function(errors,putils,errorType) {
+var JsonParser_$46 = function(errors,putils,errorType) {
if(errorType == null) {
errorType = 0;
}
json2object_reader_BaseParser.call(this,errors,putils,errorType);
this.value = false;
};
-JsonParser_$44.__name__ = true;
-JsonParser_$44.__super__ = json2object_reader_BaseParser;
-JsonParser_$44.prototype = $extend(json2object_reader_BaseParser.prototype,{
+JsonParser_$46.__name__ = true;
+JsonParser_$46.__super__ = json2object_reader_BaseParser;
+JsonParser_$46.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
this.errors.push(json2object_Error.IncorrectType(variable,"Bool",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
@@ -1357,17 +1402,17 @@ JsonParser_$44.prototype = $extend(json2object_reader_BaseParser.prototype,{
,loadJsonBool: function(b,pos,variable) {
this.value = b;
}
- ,__class__: JsonParser_$44
+ ,__class__: JsonParser_$46
});
-var JsonParser_$46 = function(errors,putils,errorType) {
+var JsonParser_$48 = function(errors,putils,errorType) {
if(errorType == null) {
errorType = 0;
}
json2object_reader_BaseParser.call(this,errors,putils,errorType);
};
-JsonParser_$46.__name__ = true;
-JsonParser_$46.__super__ = json2object_reader_BaseParser;
-JsonParser_$46.prototype = $extend(json2object_reader_BaseParser.prototype,{
+JsonParser_$48.__name__ = true;
+JsonParser_$48.__super__ = json2object_reader_BaseParser;
+JsonParser_$48.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
this.errors.push(json2object_Error.IncorrectType(variable,"String",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
@@ -1378,17 +1423,17 @@ JsonParser_$46.prototype = $extend(json2object_reader_BaseParser.prototype,{
,loadJsonString: function(s,pos,variable) {
this.value = s;
}
- ,__class__: JsonParser_$46
+ ,__class__: JsonParser_$48
});
-var JsonParser_$47 = function(errors,putils,errorType) {
+var JsonParser_$49 = function(errors,putils,errorType) {
if(errorType == null) {
errorType = 0;
}
json2object_reader_BaseParser.call(this,errors,putils,errorType);
};
-JsonParser_$47.__name__ = true;
-JsonParser_$47.__super__ = json2object_reader_BaseParser;
-JsonParser_$47.prototype = $extend(json2object_reader_BaseParser.prototype,{
+JsonParser_$49.__name__ = true;
+JsonParser_$49.__super__ = json2object_reader_BaseParser;
+JsonParser_$49.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
this.errors.push(json2object_Error.IncorrectType(variable,"Array<ClientData>",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
@@ -1397,21 +1442,21 @@ JsonParser_$47.prototype = $extend(json2object_reader_BaseParser.prototype,{
this.value = null;
}
,loadJsonArray: function(a,pos,variable) {
- this.value = this.loadJsonArrayValue(a,($_=new JsonParser_$49(this.errors,this.putils,2),$bind($_,$_.loadJson)),variable);
+ this.value = this.loadJsonArrayValue(a,($_=new JsonParser_$51(this.errors,this.putils,2),$bind($_,$_.loadJson)),variable);
}
- ,__class__: JsonParser_$47
+ ,__class__: JsonParser_$49
});
-var JsonParser_$49 = function(errors,putils,errorType) {
+var JsonParser_$5 = function(errors,putils,errorType) {
if(errorType == null) {
errorType = 0;
}
json2object_reader_BaseParser.call(this,errors,putils,errorType);
};
-JsonParser_$49.__name__ = true;
-JsonParser_$49.__super__ = json2object_reader_BaseParser;
-JsonParser_$49.prototype = $extend(json2object_reader_BaseParser.prototype,{
+JsonParser_$5.__name__ = true;
+JsonParser_$5.__super__ = json2object_reader_BaseParser;
+JsonParser_$5.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
- this.errors.push(json2object_Error.IncorrectType(variable,"{ name : String, group : Int }",pos));
+ this.errors.push(json2object_Error.IncorrectType(variable,"{ time : Float, name : String }",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
}
,loadJsonNull: function(pos,variable) {
@@ -1419,18 +1464,18 @@ JsonParser_$49.prototype = $extend(json2object_reader_BaseParser.prototype,{
}
,loadJsonObject: function(o,pos,variable) {
var assigned = new haxe_ds_StringMap();
- this.objectSetupAssign(assigned,["group","name"],[false,false]);
+ this.objectSetupAssign(assigned,["name","time"],[false,false]);
this.value = this.getAuto();
var _g = 0;
while(_g < o.length) {
var field = o[_g];
++_g;
switch(field.name) {
- case "group":
- this.value.group = this.loadObjectField(($_=new JsonParser_$50(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"group",assigned,this.value.group,pos);
- break;
case "name":
- this.value.name = this.loadObjectField(($_=new JsonParser_$42(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"name",assigned,this.value.name,pos);
+ this.value.name = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"name",assigned,this.value.name,pos);
+ break;
+ case "time":
+ this.value.time = this.loadObjectField(($_=new JsonParser_$45(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"time",assigned,this.value.time,pos);
break;
default:
this.errors.push(json2object_Error.UnknownVariable(field.name,this.putils.convertPosition(field.namePos)));
@@ -1439,21 +1484,21 @@ JsonParser_$49.prototype = $extend(json2object_reader_BaseParser.prototype,{
this.objectErrors(assigned,pos);
}
,getAuto: function() {
- return { group : new JsonParser_$50([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), name : new JsonParser_$42([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
+ return { name : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), time : new JsonParser_$45([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
}
- ,__class__: JsonParser_$49
+ ,__class__: JsonParser_$5
});
-var JsonParser_$5 = function(errors,putils,errorType) {
+var JsonParser_$51 = function(errors,putils,errorType) {
if(errorType == null) {
errorType = 0;
}
json2object_reader_BaseParser.call(this,errors,putils,errorType);
};
-JsonParser_$5.__name__ = true;
-JsonParser_$5.__super__ = json2object_reader_BaseParser;
-JsonParser_$5.prototype = $extend(json2object_reader_BaseParser.prototype,{
+JsonParser_$51.__name__ = true;
+JsonParser_$51.__super__ = json2object_reader_BaseParser;
+JsonParser_$51.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
- this.errors.push(json2object_Error.IncorrectType(variable,"{ time : Float, name : String }",pos));
+ this.errors.push(json2object_Error.IncorrectType(variable,"{ name : String, group : Int }",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
}
,loadJsonNull: function(pos,variable) {
@@ -1461,18 +1506,18 @@ JsonParser_$5.prototype = $extend(json2object_reader_BaseParser.prototype,{
}
,loadJsonObject: function(o,pos,variable) {
var assigned = new haxe_ds_StringMap();
- this.objectSetupAssign(assigned,["name","time"],[false,false]);
+ this.objectSetupAssign(assigned,["group","name"],[false,false]);
this.value = this.getAuto();
var _g = 0;
while(_g < o.length) {
var field = o[_g];
++_g;
switch(field.name) {
- case "name":
- this.value.name = this.loadObjectField(($_=new JsonParser_$42(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"name",assigned,this.value.name,pos);
+ case "group":
+ this.value.group = this.loadObjectField(($_=new JsonParser_$52(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"group",assigned,this.value.group,pos);
break;
- case "time":
- this.value.time = this.loadObjectField(($_=new JsonParser_$43(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"time",assigned,this.value.time,pos);
+ case "name":
+ this.value.name = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"name",assigned,this.value.name,pos);
break;
default:
this.errors.push(json2object_Error.UnknownVariable(field.name,this.putils.convertPosition(field.namePos)));
@@ -1481,20 +1526,20 @@ JsonParser_$5.prototype = $extend(json2object_reader_BaseParser.prototype,{
this.objectErrors(assigned,pos);
}
,getAuto: function() {
- return { name : new JsonParser_$42([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), time : new JsonParser_$43([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
+ return { group : new JsonParser_$52([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), name : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
}
- ,__class__: JsonParser_$5
+ ,__class__: JsonParser_$51
});
-var JsonParser_$50 = function(errors,putils,errorType) {
+var JsonParser_$52 = function(errors,putils,errorType) {
if(errorType == null) {
errorType = 0;
}
json2object_reader_BaseParser.call(this,errors,putils,errorType);
this.value = 0;
};
-JsonParser_$50.__name__ = true;
-JsonParser_$50.__super__ = json2object_reader_BaseParser;
-JsonParser_$50.prototype = $extend(json2object_reader_BaseParser.prototype,{
+JsonParser_$52.__name__ = true;
+JsonParser_$52.__super__ = json2object_reader_BaseParser;
+JsonParser_$52.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
this.errors.push(json2object_Error.IncorrectType(variable,"Int",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
@@ -1502,17 +1547,17 @@ JsonParser_$50.prototype = $extend(json2object_reader_BaseParser.prototype,{
,loadJsonNumber: function(f,pos,variable) {
this.value = this.loadJsonInt(f,pos,variable,this.value);
}
- ,__class__: JsonParser_$50
+ ,__class__: JsonParser_$52
});
-var JsonParser_$52 = function(errors,putils,errorType) {
+var JsonParser_$54 = function(errors,putils,errorType) {
if(errorType == null) {
errorType = 0;
}
json2object_reader_BaseParser.call(this,errors,putils,errorType);
};
-JsonParser_$52.__name__ = true;
-JsonParser_$52.__super__ = json2object_reader_BaseParser;
-JsonParser_$52.prototype = $extend(json2object_reader_BaseParser.prototype,{
+JsonParser_$54.__name__ = true;
+JsonParser_$54.__super__ = json2object_reader_BaseParser;
+JsonParser_$54.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
this.errors.push(json2object_Error.IncorrectType(variable,"Array<ClientData>",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
@@ -1521,19 +1566,19 @@ JsonParser_$52.prototype = $extend(json2object_reader_BaseParser.prototype,{
this.value = null;
}
,loadJsonArray: function(a,pos,variable) {
- this.value = this.loadJsonArrayValue(a,($_=new JsonParser_$49(this.errors,this.putils,2),$bind($_,$_.loadJson)),variable);
+ this.value = this.loadJsonArrayValue(a,($_=new JsonParser_$51(this.errors,this.putils,2),$bind($_,$_.loadJson)),variable);
}
- ,__class__: JsonParser_$52
+ ,__class__: JsonParser_$54
});
-var JsonParser_$54 = function(errors,putils,errorType) {
+var JsonParser_$56 = function(errors,putils,errorType) {
if(errorType == null) {
errorType = 0;
}
json2object_reader_BaseParser.call(this,errors,putils,errorType);
};
-JsonParser_$54.__name__ = true;
-JsonParser_$54.__super__ = json2object_reader_BaseParser;
-JsonParser_$54.prototype = $extend(json2object_reader_BaseParser.prototype,{
+JsonParser_$56.__name__ = true;
+JsonParser_$56.__super__ = json2object_reader_BaseParser;
+JsonParser_$56.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
this.errors.push(json2object_Error.IncorrectType(variable,"Bool",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
@@ -1544,40 +1589,88 @@ JsonParser_$54.prototype = $extend(json2object_reader_BaseParser.prototype,{
,loadJsonBool: function(b,pos,variable) {
this.value = b;
}
- ,__class__: JsonParser_$54
+ ,__class__: JsonParser_$56
});
-var JsonParser_$56 = function(errors,putils,errorType) {
+var JsonParser_$59 = function(errors,putils,errorType) {
if(errorType == null) {
errorType = 0;
}
json2object_reader_BaseParser.call(this,errors,putils,errorType);
};
-JsonParser_$56.__name__ = true;
-JsonParser_$56.__super__ = json2object_reader_BaseParser;
-JsonParser_$56.prototype = $extend(json2object_reader_BaseParser.prototype,{
+JsonParser_$59.__name__ = true;
+JsonParser_$59.__super__ = json2object_reader_BaseParser;
+JsonParser_$59.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
- this.errors.push(json2object_Error.IncorrectType(variable,"Float",pos));
+ this.errors.push(json2object_Error.IncorrectType(variable,"{ videoDetails : utils.YoutubeVideoDetails, ?liveData : Null<{ manifestUrl : String }>, ?formats : Null<Array<utils.YoutubeVideoFormat>>, ?adaptiveFormats : Null<Array<utils.YoutubeVideoFormat>> }",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
}
,loadJsonNull: function(pos,variable) {
this.value = null;
}
- ,loadJsonNumber: function(f,pos,variable) {
- this.value = this.loadJsonFloat(f,pos,variable,this.value);
+ ,loadJsonObject: function(o,pos,variable) {
+ var assigned = new haxe_ds_StringMap();
+ this.objectSetupAssign(assigned,["adaptiveFormats","formats","liveData","videoDetails"],[true,true,true,false]);
+ this.value = this.getAuto();
+ var _g = 0;
+ while(_g < o.length) {
+ var field = o[_g];
+ ++_g;
+ switch(field.name) {
+ case "adaptiveFormats":
+ this.value.adaptiveFormats = this.loadObjectField(($_=new JsonParser_$63(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"adaptiveFormats",assigned,this.value.adaptiveFormats,pos);
+ break;
+ case "formats":
+ this.value.formats = this.loadObjectField(($_=new JsonParser_$63(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"formats",assigned,this.value.formats,pos);
+ break;
+ case "liveData":
+ this.value.liveData = this.loadObjectField(($_=new JsonParser_$65(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"liveData",assigned,this.value.liveData,pos);
+ break;
+ case "videoDetails":
+ this.value.videoDetails = this.loadObjectField(($_=new JsonParser_$67(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"videoDetails",assigned,this.value.videoDetails,pos);
+ break;
+ default:
+ this.errors.push(json2object_Error.UnknownVariable(field.name,this.putils.convertPosition(field.namePos)));
+ }
+ }
+ this.objectErrors(assigned,pos);
}
- ,__class__: JsonParser_$56
+ ,getAuto: function() {
+ return { adaptiveFormats : new JsonParser_$63([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), formats : new JsonParser_$63([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), liveData : new JsonParser_$65([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), videoDetails : new JsonParser_$67([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
+ }
+ ,__class__: JsonParser_$59
});
-var JsonParser_$58 = function(errors,putils,errorType) {
+var JsonParser_$63 = function(errors,putils,errorType) {
if(errorType == null) {
errorType = 0;
}
json2object_reader_BaseParser.call(this,errors,putils,errorType);
};
-JsonParser_$58.__name__ = true;
-JsonParser_$58.__super__ = json2object_reader_BaseParser;
-JsonParser_$58.prototype = $extend(json2object_reader_BaseParser.prototype,{
+JsonParser_$63.__name__ = true;
+JsonParser_$63.__super__ = json2object_reader_BaseParser;
+JsonParser_$63.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
- this.errors.push(json2object_Error.IncorrectType(variable,"{ youtubePlaylistLimit : Int, youtubeApiKey : String, userVideoLimit : Int, totalVideoLimit : Int, templateUrl : String, serverChatHistory : Int, ?salt : Null<String>, requestLeaderOnPause : Bool, port : Int, permissions : Permissions, maxMessageLength : Int, maxLoginLength : Int, localNetworkOnly : Bool, localAdmins : Bool, ?isVerbose : Null<Bool>, filters : Array<Filter>, emotes : Array<Emote>, channelName : String, allowProxyIps : Bool }",pos));
+ this.errors.push(json2object_Error.IncorrectType(variable,"Array<utils.YoutubeVideoFormat>",pos));
+ json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
+ }
+ ,loadJsonNull: function(pos,variable) {
+ this.value = null;
+ }
+ ,loadJsonArray: function(a,pos,variable) {
+ this.value = this.loadJsonArrayValue(a,($_=new JsonParser_$73(this.errors,this.putils,2),$bind($_,$_.loadJson)),variable);
+ }
+ ,__class__: JsonParser_$63
+});
+var JsonParser_$65 = function(errors,putils,errorType) {
+ if(errorType == null) {
+ errorType = 0;
+ }
+ json2object_reader_BaseParser.call(this,errors,putils,errorType);
+};
+JsonParser_$65.__name__ = true;
+JsonParser_$65.__super__ = json2object_reader_BaseParser;
+JsonParser_$65.prototype = $extend(json2object_reader_BaseParser.prototype,{
+ onIncorrectType: function(pos,variable) {
+ this.errors.push(json2object_Error.IncorrectType(variable,"{ manifestUrl : String }",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
}
,loadJsonNull: function(pos,variable) {
@@ -1585,69 +1678,94 @@ JsonParser_$58.prototype = $extend(json2object_reader_BaseParser.prototype,{
}
,loadJsonObject: function(o,pos,variable) {
var assigned = new haxe_ds_StringMap();
- this.objectSetupAssign(assigned,["allowProxyIps","channelName","emotes","filters","isVerbose","localAdmins","localNetworkOnly","maxLoginLength","maxMessageLength","permissions","port","requestLeaderOnPause","salt","serverChatHistory","templateUrl","totalVideoLimit","userVideoLimit","youtubeApiKey","youtubePlaylistLimit"],[false,false,false,false,true,false,false,false,false,false,false,false,true,false,false,false,false,false,false]);
+ this.objectSetupAssign(assigned,["manifestUrl"],[false]);
+ this.value = this.getAuto();
+ var _g = 0;
+ while(_g < o.length) {
+ var field = o[_g];
+ ++_g;
+ if(field.name == "manifestUrl") {
+ this.value.manifestUrl = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"manifestUrl",assigned,this.value.manifestUrl,pos);
+ } else {
+ this.errors.push(json2object_Error.UnknownVariable(field.name,this.putils.convertPosition(field.namePos)));
+ }
+ }
+ this.objectErrors(assigned,pos);
+ }
+ ,getAuto: function() {
+ return { manifestUrl : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
+ }
+ ,__class__: JsonParser_$65
+});
+var JsonParser_$67 = function(errors,putils,errorType) {
+ if(errorType == null) {
+ errorType = 0;
+ }
+ json2object_reader_BaseParser.call(this,errors,putils,errorType);
+};
+JsonParser_$67.__name__ = true;
+JsonParser_$67.__super__ = json2object_reader_BaseParser;
+JsonParser_$67.prototype = $extend(json2object_reader_BaseParser.prototype,{
+ onIncorrectType: function(pos,variable) {
+ this.errors.push(json2object_Error.IncorrectType(variable,"{ viewCount : String, videoId : String, title : String, thumbnail : { thumbnails : Array<{ width : Int, url : String, height : Int }> }, shortDescription : String, lengthSeconds : String, keywords : Array<String>, isUnpluggedCorpus : Bool, isPrivate : Bool, isOwnerViewing : Bool, isLiveContent : Bool, isCrawlable : Bool, channelId : String, author : String, allowRatings : Bool }",pos));
+ json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
+ }
+ ,loadJsonNull: function(pos,variable) {
+ this.value = null;
+ }
+ ,loadJsonObject: function(o,pos,variable) {
+ var assigned = new haxe_ds_StringMap();
+ this.objectSetupAssign(assigned,["allowRatings","author","channelId","isCrawlable","isLiveContent","isOwnerViewing","isPrivate","isUnpluggedCorpus","keywords","lengthSeconds","shortDescription","thumbnail","title","videoId","viewCount"],[false,false,false,false,false,false,false,false,false,false,false,false,false,false,false]);
this.value = this.getAuto();
var _g = 0;
while(_g < o.length) {
var field = o[_g];
++_g;
switch(field.name) {
- case "allowProxyIps":
- this.value.allowProxyIps = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"allowProxyIps",assigned,this.value.allowProxyIps,pos);
- break;
- case "channelName":
- this.value.channelName = this.loadObjectField(($_=new JsonParser_$42(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"channelName",assigned,this.value.channelName,pos);
- break;
- case "emotes":
- this.value.emotes = this.loadObjectField(($_=new JsonParser_$62(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"emotes",assigned,this.value.emotes,pos);
+ case "allowRatings":
+ this.value.allowRatings = this.loadObjectField(($_=new JsonParser_$46(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"allowRatings",assigned,this.value.allowRatings,pos);
break;
- case "filters":
- this.value.filters = this.loadObjectField(($_=new JsonParser_$63(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"filters",assigned,this.value.filters,pos);
- break;
- case "isVerbose":
- this.value.isVerbose = this.loadObjectField(($_=new JsonParser_$54(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"isVerbose",assigned,this.value.isVerbose,pos);
- break;
- case "localAdmins":
- this.value.localAdmins = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"localAdmins",assigned,this.value.localAdmins,pos);
+ case "author":
+ this.value.author = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"author",assigned,this.value.author,pos);
break;
- case "localNetworkOnly":
- this.value.localNetworkOnly = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"localNetworkOnly",assigned,this.value.localNetworkOnly,pos);
+ case "channelId":
+ this.value.channelId = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"channelId",assigned,this.value.channelId,pos);
break;
- case "maxLoginLength":
- this.value.maxLoginLength = this.loadObjectField(($_=new JsonParser_$50(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"maxLoginLength",assigned,this.value.maxLoginLength,pos);
+ case "isCrawlable":
+ this.value.isCrawlable = this.loadObjectField(($_=new JsonParser_$46(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"isCrawlable",assigned,this.value.isCrawlable,pos);
break;
- case "maxMessageLength":
- this.value.maxMessageLength = this.loadObjectField(($_=new JsonParser_$50(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"maxMessageLength",assigned,this.value.maxMessageLength,pos);
+ case "isLiveContent":
+ this.value.isLiveContent = this.loadObjectField(($_=new JsonParser_$46(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"isLiveContent",assigned,this.value.isLiveContent,pos);
break;
- case "permissions":
- this.value.permissions = this.loadObjectField(($_=new JsonParser_$65(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"permissions",assigned,this.value.permissions,pos);
+ case "isOwnerViewing":
+ this.value.isOwnerViewing = this.loadObjectField(($_=new JsonParser_$46(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"isOwnerViewing",assigned,this.value.isOwnerViewing,pos);
break;
- case "port":
- this.value.port = this.loadObjectField(($_=new JsonParser_$50(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"port",assigned,this.value.port,pos);
+ case "isPrivate":
+ this.value.isPrivate = this.loadObjectField(($_=new JsonParser_$46(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"isPrivate",assigned,this.value.isPrivate,pos);
break;
- case "requestLeaderOnPause":
- this.value.requestLeaderOnPause = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"requestLeaderOnPause",assigned,this.value.requestLeaderOnPause,pos);
+ case "isUnpluggedCorpus":
+ this.value.isUnpluggedCorpus = this.loadObjectField(($_=new JsonParser_$46(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"isUnpluggedCorpus",assigned,this.value.isUnpluggedCorpus,pos);
break;
- case "salt":
- this.value.salt = this.loadObjectField(($_=new JsonParser_$46(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"salt",assigned,this.value.salt,pos);
+ case "keywords":
+ this.value.keywords = this.loadObjectField(($_=new JsonParser_$68(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"keywords",assigned,this.value.keywords,pos);
break;
- case "serverChatHistory":
- this.value.serverChatHistory = this.loadObjectField(($_=new JsonParser_$50(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"serverChatHistory",assigned,this.value.serverChatHistory,pos);
+ case "lengthSeconds":
+ this.value.lengthSeconds = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"lengthSeconds",assigned,this.value.lengthSeconds,pos);
break;
- case "templateUrl":
- this.value.templateUrl = this.loadObjectField(($_=new JsonParser_$42(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"templateUrl",assigned,this.value.templateUrl,pos);
+ case "shortDescription":
+ this.value.shortDescription = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"shortDescription",assigned,this.value.shortDescription,pos);
break;
- case "totalVideoLimit":
- this.value.totalVideoLimit = this.loadObjectField(($_=new JsonParser_$50(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"totalVideoLimit",assigned,this.value.totalVideoLimit,pos);
+ case "thumbnail":
+ this.value.thumbnail = this.loadObjectField(($_=new JsonParser_$69(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"thumbnail",assigned,this.value.thumbnail,pos);
break;
- case "userVideoLimit":
- this.value.userVideoLimit = this.loadObjectField(($_=new JsonParser_$50(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"userVideoLimit",assigned,this.value.userVideoLimit,pos);
+ case "title":
+ this.value.title = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"title",assigned,this.value.title,pos);
break;
- case "youtubeApiKey":
- this.value.youtubeApiKey = this.loadObjectField(($_=new JsonParser_$42(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"youtubeApiKey",assigned,this.value.youtubeApiKey,pos);
+ case "videoId":
+ this.value.videoId = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"videoId",assigned,this.value.videoId,pos);
break;
- case "youtubePlaylistLimit":
- this.value.youtubePlaylistLimit = this.loadObjectField(($_=new JsonParser_$50(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"youtubePlaylistLimit",assigned,this.value.youtubePlaylistLimit,pos);
+ case "viewCount":
+ this.value.viewCount = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"viewCount",assigned,this.value.viewCount,pos);
break;
default:
this.errors.push(json2object_Error.UnknownVariable(field.name,this.putils.convertPosition(field.namePos)));
@@ -1656,42 +1774,42 @@ JsonParser_$58.prototype = $extend(json2object_reader_BaseParser.prototype,{
this.objectErrors(assigned,pos);
}
,getAuto: function() {
- return { allowProxyIps : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), channelName : new JsonParser_$42([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), emotes : new JsonParser_$62([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), filters : new JsonParser_$63([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), isVerbose : new JsonParser_$54([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), localAdmins : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), localNetworkOnly : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), maxLoginLength : new JsonParser_$50([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), maxMessageLength : new JsonParser_$50([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), permissions : new JsonParser_$65([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), port : new JsonParser_$50([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), requestLeaderOnPause : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), salt : new JsonParser_$46([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), serverChatHistory : new JsonParser_$50([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), templateUrl : new JsonParser_$42([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), totalVideoLimit : new JsonParser_$50([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), userVideoLimit : new JsonParser_$50([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), youtubeApiKey : new JsonParser_$42([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), youtubePlaylistLimit : new JsonParser_$50([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
+ return { allowRatings : new JsonParser_$46([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), author : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), channelId : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), isCrawlable : new JsonParser_$46([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), isLiveContent : new JsonParser_$46([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), isOwnerViewing : new JsonParser_$46([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), isPrivate : new JsonParser_$46([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), isUnpluggedCorpus : new JsonParser_$46([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), keywords : new JsonParser_$68([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), lengthSeconds : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), shortDescription : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), thumbnail : new JsonParser_$69([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), title : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), videoId : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), viewCount : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
}
- ,__class__: JsonParser_$58
+ ,__class__: JsonParser_$67
});
-var JsonParser_$59 = function(errors,putils,errorType) {
+var JsonParser_$68 = function(errors,putils,errorType) {
if(errorType == null) {
errorType = 0;
}
json2object_reader_BaseParser.call(this,errors,putils,errorType);
};
-JsonParser_$59.__name__ = true;
-JsonParser_$59.__super__ = json2object_reader_BaseParser;
-JsonParser_$59.prototype = $extend(json2object_reader_BaseParser.prototype,{
+JsonParser_$68.__name__ = true;
+JsonParser_$68.__super__ = json2object_reader_BaseParser;
+JsonParser_$68.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
- this.errors.push(json2object_Error.IncorrectType(variable,"Array<Message>",pos));
+ this.errors.push(json2object_Error.IncorrectType(variable,"Array<String>",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
}
,loadJsonNull: function(pos,variable) {
this.value = null;
}
,loadJsonArray: function(a,pos,variable) {
- this.value = this.loadJsonArrayValue(a,($_=new JsonParser_$61(this.errors,this.putils,2),$bind($_,$_.loadJson)),variable);
+ this.value = this.loadJsonArrayValue(a,($_=new JsonParser_$44(this.errors,this.putils,2),$bind($_,$_.loadJson)),variable);
}
- ,__class__: JsonParser_$59
+ ,__class__: JsonParser_$68
});
-var JsonParser_$61 = function(errors,putils,errorType) {
+var JsonParser_$69 = function(errors,putils,errorType) {
if(errorType == null) {
errorType = 0;
}
json2object_reader_BaseParser.call(this,errors,putils,errorType);
};
-JsonParser_$61.__name__ = true;
-JsonParser_$61.__super__ = json2object_reader_BaseParser;
-JsonParser_$61.prototype = $extend(json2object_reader_BaseParser.prototype,{
+JsonParser_$69.__name__ = true;
+JsonParser_$69.__super__ = json2object_reader_BaseParser;
+JsonParser_$69.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
- this.errors.push(json2object_Error.IncorrectType(variable,"{ time : String, text : String, name : String }",pos));
+ this.errors.push(json2object_Error.IncorrectType(variable,"{ thumbnails : Array<{ width : Int, url : String, height : Int }> }",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
}
,loadJsonNull: function(pos,variable) {
@@ -1699,21 +1817,76 @@ JsonParser_$61.prototype = $extend(json2object_reader_BaseParser.prototype,{
}
,loadJsonObject: function(o,pos,variable) {
var assigned = new haxe_ds_StringMap();
- this.objectSetupAssign(assigned,["name","text","time"],[false,false,false]);
+ this.objectSetupAssign(assigned,["thumbnails"],[false]);
+ this.value = this.getAuto();
+ var _g = 0;
+ while(_g < o.length) {
+ var field = o[_g];
+ ++_g;
+ if(field.name == "thumbnails") {
+ this.value.thumbnails = this.loadObjectField(($_=new JsonParser_$70(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"thumbnails",assigned,this.value.thumbnails,pos);
+ } else {
+ this.errors.push(json2object_Error.UnknownVariable(field.name,this.putils.convertPosition(field.namePos)));
+ }
+ }
+ this.objectErrors(assigned,pos);
+ }
+ ,getAuto: function() {
+ return { thumbnails : new JsonParser_$70([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
+ }
+ ,__class__: JsonParser_$69
+});
+var JsonParser_$7 = function(errors,putils,errorType) {
+ if(errorType == null) {
+ errorType = 0;
+ }
+ json2object_reader_BaseParser.call(this,errors,putils,errorType);
+};
+JsonParser_$7.__name__ = true;
+JsonParser_$7.__super__ = json2object_reader_BaseParser;
+JsonParser_$7.prototype = $extend(json2object_reader_BaseParser.prototype,{
+ onIncorrectType: function(pos,variable) {
+ this.errors.push(json2object_Error.IncorrectType(variable,"{ videoList : Array<VideoItem>, itemPos : Int, isUnknownClient : Bool, isPlaylistOpen : Bool, history : Array<Message>, globalIp : String, config : Config, clients : Array<ClientData>, clientName : String }",pos));
+ json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
+ }
+ ,loadJsonNull: function(pos,variable) {
+ this.value = null;
+ }
+ ,loadJsonObject: function(o,pos,variable) {
+ var assigned = new haxe_ds_StringMap();
+ this.objectSetupAssign(assigned,["clientName","clients","config","globalIp","history","isPlaylistOpen","isUnknownClient","itemPos","videoList"],[false,false,false,false,false,false,false,false,false]);
this.value = this.getAuto();
var _g = 0;
while(_g < o.length) {
var field = o[_g];
++_g;
switch(field.name) {
- case "name":
- this.value.name = this.loadObjectField(($_=new JsonParser_$42(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"name",assigned,this.value.name,pos);
+ case "clientName":
+ this.value.clientName = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"clientName",assigned,this.value.clientName,pos);
break;
- case "text":
- this.value.text = this.loadObjectField(($_=new JsonParser_$42(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"text",assigned,this.value.text,pos);
+ case "clients":
+ this.value.clients = this.loadObjectField(($_=new JsonParser_$49(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"clients",assigned,this.value.clients,pos);
break;
- case "time":
- this.value.time = this.loadObjectField(($_=new JsonParser_$42(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"time",assigned,this.value.time,pos);
+ case "config":
+ this.value.config = this.loadObjectField(($_=new JsonParser_$81(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"config",assigned,this.value.config,pos);
+ break;
+ case "globalIp":
+ this.value.globalIp = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"globalIp",assigned,this.value.globalIp,pos);
+ break;
+ case "history":
+ this.value.history = this.loadObjectField(($_=new JsonParser_$82(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"history",assigned,this.value.history,pos);
+ break;
+ case "isPlaylistOpen":
+ this.value.isPlaylistOpen = this.loadObjectField(($_=new JsonParser_$46(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"isPlaylistOpen",assigned,this.value.isPlaylistOpen,pos);
+ break;
+ case "isUnknownClient":
+ this.value.isUnknownClient = this.loadObjectField(($_=new JsonParser_$46(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"isUnknownClient",assigned,this.value.isUnknownClient,pos);
+ break;
+ case "itemPos":
+ this.value.itemPos = this.loadObjectField(($_=new JsonParser_$52(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"itemPos",assigned,this.value.itemPos,pos);
+ break;
+ case "videoList":
+ this.value.videoList = this.loadObjectField(($_=new JsonParser_$41(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"videoList",assigned,this.value.videoList,pos);
break;
default:
this.errors.push(json2object_Error.UnknownVariable(field.name,this.putils.convertPosition(field.namePos)));
@@ -1722,21 +1895,21 @@ JsonParser_$61.prototype = $extend(json2object_reader_BaseParser.prototype,{
this.objectErrors(assigned,pos);
}
,getAuto: function() {
- return { name : new JsonParser_$42([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), text : new JsonParser_$42([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), time : new JsonParser_$42([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
+ return { clientName : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), clients : new JsonParser_$49([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), config : new JsonParser_$81([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), globalIp : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), history : new JsonParser_$82([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), isPlaylistOpen : new JsonParser_$46([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), isUnknownClient : new JsonParser_$46([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), itemPos : new JsonParser_$52([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), videoList : new JsonParser_$41([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
}
- ,__class__: JsonParser_$61
+ ,__class__: JsonParser_$7
});
-var JsonParser_$62 = function(errors,putils,errorType) {
+var JsonParser_$70 = function(errors,putils,errorType) {
if(errorType == null) {
errorType = 0;
}
json2object_reader_BaseParser.call(this,errors,putils,errorType);
};
-JsonParser_$62.__name__ = true;
-JsonParser_$62.__super__ = json2object_reader_BaseParser;
-JsonParser_$62.prototype = $extend(json2object_reader_BaseParser.prototype,{
+JsonParser_$70.__name__ = true;
+JsonParser_$70.__super__ = json2object_reader_BaseParser;
+JsonParser_$70.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
- this.errors.push(json2object_Error.IncorrectType(variable,"Array<Emote>",pos));
+ this.errors.push(json2object_Error.IncorrectType(variable,"Array<{ width : Int, url : String, height : Int }>",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
}
,loadJsonNull: function(pos,variable) {
@@ -1745,40 +1918,64 @@ JsonParser_$62.prototype = $extend(json2object_reader_BaseParser.prototype,{
,loadJsonArray: function(a,pos,variable) {
this.value = this.loadJsonArrayValue(a,($_=new JsonParser_$71(this.errors,this.putils,2),$bind($_,$_.loadJson)),variable);
}
- ,__class__: JsonParser_$62
+ ,__class__: JsonParser_$70
});
-var JsonParser_$63 = function(errors,putils,errorType) {
+var JsonParser_$71 = function(errors,putils,errorType) {
if(errorType == null) {
errorType = 0;
}
json2object_reader_BaseParser.call(this,errors,putils,errorType);
};
-JsonParser_$63.__name__ = true;
-JsonParser_$63.__super__ = json2object_reader_BaseParser;
-JsonParser_$63.prototype = $extend(json2object_reader_BaseParser.prototype,{
+JsonParser_$71.__name__ = true;
+JsonParser_$71.__super__ = json2object_reader_BaseParser;
+JsonParser_$71.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
- this.errors.push(json2object_Error.IncorrectType(variable,"Array<Filter>",pos));
+ this.errors.push(json2object_Error.IncorrectType(variable,"{ width : Int, url : String, height : Int }",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
}
,loadJsonNull: function(pos,variable) {
this.value = null;
}
- ,loadJsonArray: function(a,pos,variable) {
- this.value = this.loadJsonArrayValue(a,($_=new JsonParser_$69(this.errors,this.putils,2),$bind($_,$_.loadJson)),variable);
+ ,loadJsonObject: function(o,pos,variable) {
+ var assigned = new haxe_ds_StringMap();
+ this.objectSetupAssign(assigned,["height","url","width"],[false,false,false]);
+ this.value = this.getAuto();
+ var _g = 0;
+ while(_g < o.length) {
+ var field = o[_g];
+ ++_g;
+ switch(field.name) {
+ case "height":
+ this.value.height = this.loadObjectField(($_=new JsonParser_$52(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"height",assigned,this.value.height,pos);
+ break;
+ case "url":
+ this.value.url = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"url",assigned,this.value.url,pos);
+ break;
+ case "width":
+ this.value.width = this.loadObjectField(($_=new JsonParser_$52(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"width",assigned,this.value.width,pos);
+ break;
+ default:
+ this.errors.push(json2object_Error.UnknownVariable(field.name,this.putils.convertPosition(field.namePos)));
+ }
+ }
+ this.objectErrors(assigned,pos);
}
- ,__class__: JsonParser_$63
+ ,getAuto: function() {
+ return { height : new JsonParser_$52([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), url : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), width : new JsonParser_$52([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
+ }
+ ,__class__: JsonParser_$71
});
-var JsonParser_$65 = function(errors,putils,errorType) {
+var JsonParser_$73 = function(errors,putils,errorType) {
if(errorType == null) {
errorType = 0;
}
json2object_reader_BaseParser.call(this,errors,putils,errorType);
};
-JsonParser_$65.__name__ = true;
-JsonParser_$65.__super__ = json2object_reader_BaseParser;
-JsonParser_$65.prototype = $extend(json2object_reader_BaseParser.prototype,{
+JsonParser_$73.__name__ = true;
+JsonParser_$73.__super__ = json2object_reader_BaseParser;
+JsonParser_$73.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
- this.errors.push(json2object_Error.IncorrectType(variable,"{ user : Array<Permission>, leader : Array<Permission>, guest : Array<Permission>, banned : Array<Permission>, admin : Array<Permission> }",pos));
+ this.errors.push(json2object_Error.IncorrectType(variable,"{ width : Int, url : String, ?signatureCipher : Null<String>, qualityLabel : String, quality : String, projectionType : String, mimeType : String, lastModified : String, itag : Int, ?initRange : Null<{ start : Int, end : Int }>, ?indexRange : Null<{ start : Int, end : Int }>, height : Int, bitrate : Int, ?audioSampleRate : Null<Int>, ?audioQuality : Null<String>, ?audioChannels : Null<Int>, approxDurationMs : String }",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
}
,loadJsonNull: function(pos,variable) {
@@ -1786,27 +1983,63 @@ JsonParser_$65.prototype = $extend(json2object_reader_BaseParser.prototype,{
}
,loadJsonObject: function(o,pos,variable) {
var assigned = new haxe_ds_StringMap();
- this.objectSetupAssign(assigned,["admin","banned","guest","leader","user"],[false,false,false,false,false]);
+ this.objectSetupAssign(assigned,["approxDurationMs","audioChannels","audioQuality","audioSampleRate","bitrate","height","indexRange","initRange","itag","lastModified","mimeType","projectionType","quality","qualityLabel","signatureCipher","url","width"],[false,true,true,true,false,false,true,true,false,false,false,false,false,false,true,false,false]);
this.value = this.getAuto();
var _g = 0;
while(_g < o.length) {
var field = o[_g];
++_g;
switch(field.name) {
- case "admin":
- this.value.admin = this.loadObjectField(($_=new JsonParser_$66(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"admin",assigned,this.value.admin,pos);
+ case "approxDurationMs":
+ this.value.approxDurationMs = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"approxDurationMs",assigned,this.value.approxDurationMs,pos);
break;
- case "banned":
- this.value.banned = this.loadObjectField(($_=new JsonParser_$66(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"banned",assigned,this.value.banned,pos);
+ case "audioChannels":
+ this.value.audioChannels = this.loadObjectField(($_=new JsonParser_$75(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"audioChannels",assigned,this.value.audioChannels,pos);
break;
- case "guest":
- this.value.guest = this.loadObjectField(($_=new JsonParser_$66(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"guest",assigned,this.value.guest,pos);
+ case "audioQuality":
+ this.value.audioQuality = this.loadObjectField(($_=new JsonParser_$48(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"audioQuality",assigned,this.value.audioQuality,pos);
break;
- case "leader":
- this.value.leader = this.loadObjectField(($_=new JsonParser_$66(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"leader",assigned,this.value.leader,pos);
+ case "audioSampleRate":
+ this.value.audioSampleRate = this.loadObjectField(($_=new JsonParser_$75(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"audioSampleRate",assigned,this.value.audioSampleRate,pos);
break;
- case "user":
- this.value.user = this.loadObjectField(($_=new JsonParser_$66(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"user",assigned,this.value.user,pos);
+ case "bitrate":
+ this.value.bitrate = this.loadObjectField(($_=new JsonParser_$52(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"bitrate",assigned,this.value.bitrate,pos);
+ break;
+ case "height":
+ this.value.height = this.loadObjectField(($_=new JsonParser_$52(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"height",assigned,this.value.height,pos);
+ break;
+ case "indexRange":
+ this.value.indexRange = this.loadObjectField(($_=new JsonParser_$77(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"indexRange",assigned,this.value.indexRange,pos);
+ break;
+ case "initRange":
+ this.value.initRange = this.loadObjectField(($_=new JsonParser_$77(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"initRange",assigned,this.value.initRange,pos);
+ break;
+ case "itag":
+ this.value.itag = this.loadObjectField(($_=new JsonParser_$52(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"itag",assigned,this.value.itag,pos);
+ break;
+ case "lastModified":
+ this.value.lastModified = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"lastModified",assigned,this.value.lastModified,pos);
+ break;
+ case "mimeType":
+ this.value.mimeType = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"mimeType",assigned,this.value.mimeType,pos);
+ break;
+ case "projectionType":
+ this.value.projectionType = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"projectionType",assigned,this.value.projectionType,pos);
+ break;
+ case "quality":
+ this.value.quality = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"quality",assigned,this.value.quality,pos);
+ break;
+ case "qualityLabel":
+ this.value.qualityLabel = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"qualityLabel",assigned,this.value.qualityLabel,pos);
+ break;
+ case "signatureCipher":
+ this.value.signatureCipher = this.loadObjectField(($_=new JsonParser_$48(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"signatureCipher",assigned,this.value.signatureCipher,pos);
+ break;
+ case "url":
+ this.value.url = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"url",assigned,this.value.url,pos);
+ break;
+ case "width":
+ this.value.width = this.loadObjectField(($_=new JsonParser_$52(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"width",assigned,this.value.width,pos);
break;
default:
this.errors.push(json2object_Error.UnknownVariable(field.name,this.putils.convertPosition(field.namePos)));
@@ -1815,64 +2048,105 @@ JsonParser_$65.prototype = $extend(json2object_reader_BaseParser.prototype,{
this.objectErrors(assigned,pos);
}
,getAuto: function() {
- return { admin : new JsonParser_$66([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), banned : new JsonParser_$66([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), guest : new JsonParser_$66([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), leader : new JsonParser_$66([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), user : new JsonParser_$66([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
+ return { approxDurationMs : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), audioChannels : new JsonParser_$75([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), audioQuality : new JsonParser_$48([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), audioSampleRate : new JsonParser_$75([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), bitrate : new JsonParser_$52([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), height : new JsonParser_$52([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), indexRange : new JsonParser_$77([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), initRange : new JsonParser_$77([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), itag : new JsonParser_$52([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), lastModified : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), mimeType : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), projectionType : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), quality : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), qualityLabel : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), signatureCipher : new JsonParser_$48([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), url : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), width : new JsonParser_$52([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
}
- ,__class__: JsonParser_$65
+ ,__class__: JsonParser_$73
});
-var JsonParser_$66 = function(errors,putils,errorType) {
+var JsonParser_$75 = function(errors,putils,errorType) {
if(errorType == null) {
errorType = 0;
}
json2object_reader_BaseParser.call(this,errors,putils,errorType);
};
-JsonParser_$66.__name__ = true;
-JsonParser_$66.__super__ = json2object_reader_BaseParser;
-JsonParser_$66.prototype = $extend(json2object_reader_BaseParser.prototype,{
+JsonParser_$75.__name__ = true;
+JsonParser_$75.__super__ = json2object_reader_BaseParser;
+JsonParser_$75.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
- this.errors.push(json2object_Error.IncorrectType(variable,"Array<Permission>",pos));
+ this.errors.push(json2object_Error.IncorrectType(variable,"Int",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
}
,loadJsonNull: function(pos,variable) {
this.value = null;
}
- ,loadJsonArray: function(a,pos,variable) {
- this.value = this.loadJsonArrayValue(a,($_=new JsonParser_$67(this.errors,this.putils,2),$bind($_,$_.loadJson)),variable);
+ ,loadJsonNumber: function(f,pos,variable) {
+ this.value = this.loadJsonInt(f,pos,variable,this.value);
}
- ,__class__: JsonParser_$66
+ ,__class__: JsonParser_$75
});
-var JsonParser_$67 = function(errors,putils,errorType) {
+var JsonParser_$77 = function(errors,putils,errorType) {
if(errorType == null) {
errorType = 0;
}
json2object_reader_BaseParser.call(this,errors,putils,errorType);
};
-JsonParser_$67.__name__ = true;
-JsonParser_$67.__super__ = json2object_reader_BaseParser;
-JsonParser_$67.prototype = $extend(json2object_reader_BaseParser.prototype,{
+JsonParser_$77.__name__ = true;
+JsonParser_$77.__super__ = json2object_reader_BaseParser;
+JsonParser_$77.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
- this.value = "guest";
- this.errors.push(json2object_Error.IncorrectType(variable,"Permission",pos));
- this.objectThrow(pos,variable);
+ this.errors.push(json2object_Error.IncorrectType(variable,"{ start : Int, end : Int }",pos));
+ json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
}
,loadJsonNull: function(pos,variable) {
this.value = null;
}
- ,loadJsonString: function(s,pos,variable) {
- this.value = this.loadString(s,pos,variable,["guest","user","leader","admin","writeChat","addVideo","removeVideo","requestLeader","rewind","clearChat","setLeader","changeOrder","toggleItemType","lockPlaylist","banClient"],"guest");
+ ,loadJsonObject: function(o,pos,variable) {
+ var assigned = new haxe_ds_StringMap();
+ this.objectSetupAssign(assigned,["end","start"],[false,false]);
+ this.value = this.getAuto();
+ var _g = 0;
+ while(_g < o.length) {
+ var field = o[_g];
+ ++_g;
+ switch(field.name) {
+ case "end":
+ this.value.end = this.loadObjectField(($_=new JsonParser_$52(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"end",assigned,this.value.end,pos);
+ break;
+ case "start":
+ this.value.start = this.loadObjectField(($_=new JsonParser_$52(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"start",assigned,this.value.start,pos);
+ break;
+ default:
+ this.errors.push(json2object_Error.UnknownVariable(field.name,this.putils.convertPosition(field.namePos)));
+ }
+ }
+ this.objectErrors(assigned,pos);
}
- ,__class__: JsonParser_$67
+ ,getAuto: function() {
+ return { end : new JsonParser_$52([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), start : new JsonParser_$52([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
+ }
+ ,__class__: JsonParser_$77
});
-var JsonParser_$69 = function(errors,putils,errorType) {
+var JsonParser_$79 = function(errors,putils,errorType) {
if(errorType == null) {
errorType = 0;
}
json2object_reader_BaseParser.call(this,errors,putils,errorType);
};
-JsonParser_$69.__name__ = true;
-JsonParser_$69.__super__ = json2object_reader_BaseParser;
-JsonParser_$69.prototype = $extend(json2object_reader_BaseParser.prototype,{
+JsonParser_$79.__name__ = true;
+JsonParser_$79.__super__ = json2object_reader_BaseParser;
+JsonParser_$79.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
- this.errors.push(json2object_Error.IncorrectType(variable,"{ replace : String, regex : String, name : String, flags : String }",pos));
+ this.errors.push(json2object_Error.IncorrectType(variable,"Float",pos));
+ json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
+ }
+ ,loadJsonNull: function(pos,variable) {
+ this.value = null;
+ }
+ ,loadJsonNumber: function(f,pos,variable) {
+ this.value = this.loadJsonFloat(f,pos,variable,this.value);
+ }
+ ,__class__: JsonParser_$79
+});
+var JsonParser_$81 = function(errors,putils,errorType) {
+ if(errorType == null) {
+ errorType = 0;
+ }
+ json2object_reader_BaseParser.call(this,errors,putils,errorType);
+};
+JsonParser_$81.__name__ = true;
+JsonParser_$81.__super__ = json2object_reader_BaseParser;
+JsonParser_$81.prototype = $extend(json2object_reader_BaseParser.prototype,{
+ onIncorrectType: function(pos,variable) {
+ this.errors.push(json2object_Error.IncorrectType(variable,"{ youtubePlaylistLimit : Int, youtubeApiKey : String, userVideoLimit : Int, totalVideoLimit : Int, templateUrl : String, serverChatHistory : Int, ?salt : Null<String>, requestLeaderOnPause : Bool, port : Int, permissions : Permissions, maxMessageLength : Int, maxLoginLength : Int, localNetworkOnly : Bool, localAdmins : Bool, ?isVerbose : Null<Bool>, filters : Array<Filter>, emotes : Array<Emote>, channelName : String, allowProxyIps : Bool }",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
}
,loadJsonNull: function(pos,variable) {
@@ -1880,24 +2154,69 @@ JsonParser_$69.prototype = $extend(json2object_reader_BaseParser.prototype,{
}
,loadJsonObject: function(o,pos,variable) {
var assigned = new haxe_ds_StringMap();
- this.objectSetupAssign(assigned,["flags","name","regex","replace"],[false,false,false,false]);
+ this.objectSetupAssign(assigned,["allowProxyIps","channelName","emotes","filters","isVerbose","localAdmins","localNetworkOnly","maxLoginLength","maxMessageLength","permissions","port","requestLeaderOnPause","salt","serverChatHistory","templateUrl","totalVideoLimit","userVideoLimit","youtubeApiKey","youtubePlaylistLimit"],[false,false,false,false,true,false,false,false,false,false,false,false,true,false,false,false,false,false,false]);
this.value = this.getAuto();
var _g = 0;
while(_g < o.length) {
var field = o[_g];
++_g;
switch(field.name) {
- case "flags":
- this.value.flags = this.loadObjectField(($_=new JsonParser_$42(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"flags",assigned,this.value.flags,pos);
+ case "allowProxyIps":
+ this.value.allowProxyIps = this.loadObjectField(($_=new JsonParser_$46(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"allowProxyIps",assigned,this.value.allowProxyIps,pos);
break;
- case "name":
- this.value.name = this.loadObjectField(($_=new JsonParser_$42(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"name",assigned,this.value.name,pos);
+ case "channelName":
+ this.value.channelName = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"channelName",assigned,this.value.channelName,pos);
break;
- case "regex":
- this.value.regex = this.loadObjectField(($_=new JsonParser_$42(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"regex",assigned,this.value.regex,pos);
+ case "emotes":
+ this.value.emotes = this.loadObjectField(($_=new JsonParser_$85(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"emotes",assigned,this.value.emotes,pos);
break;
- case "replace":
- this.value.replace = this.loadObjectField(($_=new JsonParser_$42(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"replace",assigned,this.value.replace,pos);
+ case "filters":
+ this.value.filters = this.loadObjectField(($_=new JsonParser_$86(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"filters",assigned,this.value.filters,pos);
+ break;
+ case "isVerbose":
+ this.value.isVerbose = this.loadObjectField(($_=new JsonParser_$56(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"isVerbose",assigned,this.value.isVerbose,pos);
+ break;
+ case "localAdmins":
+ this.value.localAdmins = this.loadObjectField(($_=new JsonParser_$46(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"localAdmins",assigned,this.value.localAdmins,pos);
+ break;
+ case "localNetworkOnly":
+ this.value.localNetworkOnly = this.loadObjectField(($_=new JsonParser_$46(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"localNetworkOnly",assigned,this.value.localNetworkOnly,pos);
+ break;
+ case "maxLoginLength":
+ this.value.maxLoginLength = this.loadObjectField(($_=new JsonParser_$52(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"maxLoginLength",assigned,this.value.maxLoginLength,pos);
+ break;
+ case "maxMessageLength":
+ this.value.maxMessageLength = this.loadObjectField(($_=new JsonParser_$52(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"maxMessageLength",assigned,this.value.maxMessageLength,pos);
+ break;
+ case "permissions":
+ this.value.permissions = this.loadObjectField(($_=new JsonParser_$88(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"permissions",assigned,this.value.permissions,pos);
+ break;
+ case "port":
+ this.value.port = this.loadObjectField(($_=new JsonParser_$52(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"port",assigned,this.value.port,pos);
+ break;
+ case "requestLeaderOnPause":
+ this.value.requestLeaderOnPause = this.loadObjectField(($_=new JsonParser_$46(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"requestLeaderOnPause",assigned,this.value.requestLeaderOnPause,pos);
+ break;
+ case "salt":
+ this.value.salt = this.loadObjectField(($_=new JsonParser_$48(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"salt",assigned,this.value.salt,pos);
+ break;
+ case "serverChatHistory":
+ this.value.serverChatHistory = this.loadObjectField(($_=new JsonParser_$52(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"serverChatHistory",assigned,this.value.serverChatHistory,pos);
+ break;
+ case "templateUrl":
+ this.value.templateUrl = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"templateUrl",assigned,this.value.templateUrl,pos);
+ break;
+ case "totalVideoLimit":
+ this.value.totalVideoLimit = this.loadObjectField(($_=new JsonParser_$52(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"totalVideoLimit",assigned,this.value.totalVideoLimit,pos);
+ break;
+ case "userVideoLimit":
+ this.value.userVideoLimit = this.loadObjectField(($_=new JsonParser_$52(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"userVideoLimit",assigned,this.value.userVideoLimit,pos);
+ break;
+ case "youtubeApiKey":
+ this.value.youtubeApiKey = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"youtubeApiKey",assigned,this.value.youtubeApiKey,pos);
+ break;
+ case "youtubePlaylistLimit":
+ this.value.youtubePlaylistLimit = this.loadObjectField(($_=new JsonParser_$52(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"youtubePlaylistLimit",assigned,this.value.youtubePlaylistLimit,pos);
break;
default:
this.errors.push(json2object_Error.UnknownVariable(field.name,this.putils.convertPosition(field.namePos)));
@@ -1906,21 +2225,42 @@ JsonParser_$69.prototype = $extend(json2object_reader_BaseParser.prototype,{
this.objectErrors(assigned,pos);
}
,getAuto: function() {
- return { flags : new JsonParser_$42([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), name : new JsonParser_$42([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), regex : new JsonParser_$42([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), replace : new JsonParser_$42([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
+ return { allowProxyIps : new JsonParser_$46([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), channelName : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), emotes : new JsonParser_$85([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), filters : new JsonParser_$86([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), isVerbose : new JsonParser_$56([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), localAdmins : new JsonParser_$46([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), localNetworkOnly : new JsonParser_$46([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), maxLoginLength : new JsonParser_$52([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), maxMessageLength : new JsonParser_$52([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), permissions : new JsonParser_$88([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), port : new JsonParser_$52([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), requestLeaderOnPause : new JsonParser_$46([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), salt : new JsonParser_$48([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), serverChatHistory : new JsonParser_$52([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), templateUrl : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), totalVideoLimit : new JsonParser_$52([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), userVideoLimit : new JsonParser_$52([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), youtubeApiKey : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), youtubePlaylistLimit : new JsonParser_$52([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
}
- ,__class__: JsonParser_$69
+ ,__class__: JsonParser_$81
});
-var JsonParser_$7 = function(errors,putils,errorType) {
+var JsonParser_$82 = function(errors,putils,errorType) {
if(errorType == null) {
errorType = 0;
}
json2object_reader_BaseParser.call(this,errors,putils,errorType);
};
-JsonParser_$7.__name__ = true;
-JsonParser_$7.__super__ = json2object_reader_BaseParser;
-JsonParser_$7.prototype = $extend(json2object_reader_BaseParser.prototype,{
+JsonParser_$82.__name__ = true;
+JsonParser_$82.__super__ = json2object_reader_BaseParser;
+JsonParser_$82.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
- this.errors.push(json2object_Error.IncorrectType(variable,"{ videoList : Array<VideoItem>, itemPos : Int, isUnknownClient : Bool, isPlaylistOpen : Bool, history : Array<Message>, globalIp : String, config : Config, clients : Array<ClientData>, clientName : String }",pos));
+ this.errors.push(json2object_Error.IncorrectType(variable,"Array<Message>",pos));
+ json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
+ }
+ ,loadJsonNull: function(pos,variable) {
+ this.value = null;
+ }
+ ,loadJsonArray: function(a,pos,variable) {
+ this.value = this.loadJsonArrayValue(a,($_=new JsonParser_$84(this.errors,this.putils,2),$bind($_,$_.loadJson)),variable);
+ }
+ ,__class__: JsonParser_$82
+});
+var JsonParser_$84 = function(errors,putils,errorType) {
+ if(errorType == null) {
+ errorType = 0;
+ }
+ json2object_reader_BaseParser.call(this,errors,putils,errorType);
+};
+JsonParser_$84.__name__ = true;
+JsonParser_$84.__super__ = json2object_reader_BaseParser;
+JsonParser_$84.prototype = $extend(json2object_reader_BaseParser.prototype,{
+ onIncorrectType: function(pos,variable) {
+ this.errors.push(json2object_Error.IncorrectType(variable,"{ time : String, text : String, name : String }",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
}
,loadJsonNull: function(pos,variable) {
@@ -1928,39 +2268,21 @@ JsonParser_$7.prototype = $extend(json2object_reader_BaseParser.prototype,{
}
,loadJsonObject: function(o,pos,variable) {
var assigned = new haxe_ds_StringMap();
- this.objectSetupAssign(assigned,["clientName","clients","config","globalIp","history","isPlaylistOpen","isUnknownClient","itemPos","videoList"],[false,false,false,false,false,false,false,false,false]);
+ this.objectSetupAssign(assigned,["name","text","time"],[false,false,false]);
this.value = this.getAuto();
var _g = 0;
while(_g < o.length) {
var field = o[_g];
++_g;
switch(field.name) {
- case "clientName":
- this.value.clientName = this.loadObjectField(($_=new JsonParser_$42(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"clientName",assigned,this.value.clientName,pos);
- break;
- case "clients":
- this.value.clients = this.loadObjectField(($_=new JsonParser_$47(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"clients",assigned,this.value.clients,pos);
- break;
- case "config":
- this.value.config = this.loadObjectField(($_=new JsonParser_$58(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"config",assigned,this.value.config,pos);
- break;
- case "globalIp":
- this.value.globalIp = this.loadObjectField(($_=new JsonParser_$42(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"globalIp",assigned,this.value.globalIp,pos);
- break;
- case "history":
- this.value.history = this.loadObjectField(($_=new JsonParser_$59(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"history",assigned,this.value.history,pos);
- break;
- case "isPlaylistOpen":
- this.value.isPlaylistOpen = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"isPlaylistOpen",assigned,this.value.isPlaylistOpen,pos);
- break;
- case "isUnknownClient":
- this.value.isUnknownClient = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"isUnknownClient",assigned,this.value.isUnknownClient,pos);
+ case "name":
+ this.value.name = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"name",assigned,this.value.name,pos);
break;
- case "itemPos":
- this.value.itemPos = this.loadObjectField(($_=new JsonParser_$50(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"itemPos",assigned,this.value.itemPos,pos);
+ case "text":
+ this.value.text = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"text",assigned,this.value.text,pos);
break;
- case "videoList":
- this.value.videoList = this.loadObjectField(($_=new JsonParser_$39(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"videoList",assigned,this.value.videoList,pos);
+ case "time":
+ this.value.time = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"time",assigned,this.value.time,pos);
break;
default:
this.errors.push(json2object_Error.UnknownVariable(field.name,this.putils.convertPosition(field.namePos)));
@@ -1969,21 +2291,63 @@ JsonParser_$7.prototype = $extend(json2object_reader_BaseParser.prototype,{
this.objectErrors(assigned,pos);
}
,getAuto: function() {
- return { clientName : new JsonParser_$42([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), clients : new JsonParser_$47([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), config : new JsonParser_$58([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), globalIp : new JsonParser_$42([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), history : new JsonParser_$59([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), isPlaylistOpen : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), isUnknownClient : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), itemPos : new JsonParser_$50([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), videoList : new JsonParser_$39([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
+ return { name : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), text : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), time : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
}
- ,__class__: JsonParser_$7
+ ,__class__: JsonParser_$84
});
-var JsonParser_$71 = function(errors,putils,errorType) {
+var JsonParser_$85 = function(errors,putils,errorType) {
if(errorType == null) {
errorType = 0;
}
json2object_reader_BaseParser.call(this,errors,putils,errorType);
};
-JsonParser_$71.__name__ = true;
-JsonParser_$71.__super__ = json2object_reader_BaseParser;
-JsonParser_$71.prototype = $extend(json2object_reader_BaseParser.prototype,{
+JsonParser_$85.__name__ = true;
+JsonParser_$85.__super__ = json2object_reader_BaseParser;
+JsonParser_$85.prototype = $extend(json2object_reader_BaseParser.prototype,{
onIncorrectType: function(pos,variable) {
- this.errors.push(json2object_Error.IncorrectType(variable,"{ name : String, image : String }",pos));
+ this.errors.push(json2object_Error.IncorrectType(variable,"Array<Emote>",pos));
+ json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
+ }
+ ,loadJsonNull: function(pos,variable) {
+ this.value = null;
+ }
+ ,loadJsonArray: function(a,pos,variable) {
+ this.value = this.loadJsonArrayValue(a,($_=new JsonParser_$94(this.errors,this.putils,2),$bind($_,$_.loadJson)),variable);
+ }
+ ,__class__: JsonParser_$85
+});
+var JsonParser_$86 = function(errors,putils,errorType) {
+ if(errorType == null) {
+ errorType = 0;
+ }
+ json2object_reader_BaseParser.call(this,errors,putils,errorType);
+};
+JsonParser_$86.__name__ = true;
+JsonParser_$86.__super__ = json2object_reader_BaseParser;
+JsonParser_$86.prototype = $extend(json2object_reader_BaseParser.prototype,{
+ onIncorrectType: function(pos,variable) {
+ this.errors.push(json2object_Error.IncorrectType(variable,"Array<Filter>",pos));
+ json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
+ }
+ ,loadJsonNull: function(pos,variable) {
+ this.value = null;
+ }
+ ,loadJsonArray: function(a,pos,variable) {
+ this.value = this.loadJsonArrayValue(a,($_=new JsonParser_$92(this.errors,this.putils,2),$bind($_,$_.loadJson)),variable);
+ }
+ ,__class__: JsonParser_$86
+});
+var JsonParser_$88 = function(errors,putils,errorType) {
+ if(errorType == null) {
+ errorType = 0;
+ }
+ json2object_reader_BaseParser.call(this,errors,putils,errorType);
+};
+JsonParser_$88.__name__ = true;
+JsonParser_$88.__super__ = json2object_reader_BaseParser;
+JsonParser_$88.prototype = $extend(json2object_reader_BaseParser.prototype,{
+ onIncorrectType: function(pos,variable) {
+ this.errors.push(json2object_Error.IncorrectType(variable,"{ user : Array<Permission>, leader : Array<Permission>, guest : Array<Permission>, banned : Array<Permission>, admin : Array<Permission> }",pos));
json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
}
,loadJsonNull: function(pos,variable) {
@@ -1991,18 +2355,27 @@ JsonParser_$71.prototype = $extend(json2object_reader_BaseParser.prototype,{
}
,loadJsonObject: function(o,pos,variable) {
var assigned = new haxe_ds_StringMap();
- this.objectSetupAssign(assigned,["image","name"],[false,false]);
+ this.objectSetupAssign(assigned,["admin","banned","guest","leader","user"],[false,false,false,false,false]);
this.value = this.getAuto();
var _g = 0;
while(_g < o.length) {
var field = o[_g];
++_g;
switch(field.name) {
- case "image":
- this.value.image = this.loadObjectField(($_=new JsonParser_$42(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"image",assigned,this.value.image,pos);
+ case "admin":
+ this.value.admin = this.loadObjectField(($_=new JsonParser_$89(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"admin",assigned,this.value.admin,pos);
break;
- case "name":
- this.value.name = this.loadObjectField(($_=new JsonParser_$42(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"name",assigned,this.value.name,pos);
+ case "banned":
+ this.value.banned = this.loadObjectField(($_=new JsonParser_$89(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"banned",assigned,this.value.banned,pos);
+ break;
+ case "guest":
+ this.value.guest = this.loadObjectField(($_=new JsonParser_$89(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"guest",assigned,this.value.guest,pos);
+ break;
+ case "leader":
+ this.value.leader = this.loadObjectField(($_=new JsonParser_$89(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"leader",assigned,this.value.leader,pos);
+ break;
+ case "user":
+ this.value.user = this.loadObjectField(($_=new JsonParser_$89(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"user",assigned,this.value.user,pos);
break;
default:
this.errors.push(json2object_Error.UnknownVariable(field.name,this.putils.convertPosition(field.namePos)));
@@ -2011,9 +2384,30 @@ JsonParser_$71.prototype = $extend(json2object_reader_BaseParser.prototype,{
this.objectErrors(assigned,pos);
}
,getAuto: function() {
- return { image : new JsonParser_$42([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), name : new JsonParser_$42([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
+ return { admin : new JsonParser_$89([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), banned : new JsonParser_$89([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), guest : new JsonParser_$89([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), leader : new JsonParser_$89([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), user : new JsonParser_$89([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
}
- ,__class__: JsonParser_$71
+ ,__class__: JsonParser_$88
+});
+var JsonParser_$89 = function(errors,putils,errorType) {
+ if(errorType == null) {
+ errorType = 0;
+ }
+ json2object_reader_BaseParser.call(this,errors,putils,errorType);
+};
+JsonParser_$89.__name__ = true;
+JsonParser_$89.__super__ = json2object_reader_BaseParser;
+JsonParser_$89.prototype = $extend(json2object_reader_BaseParser.prototype,{
+ onIncorrectType: function(pos,variable) {
+ this.errors.push(json2object_Error.IncorrectType(variable,"Array<Permission>",pos));
+ json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
+ }
+ ,loadJsonNull: function(pos,variable) {
+ this.value = null;
+ }
+ ,loadJsonArray: function(a,pos,variable) {
+ this.value = this.loadJsonArrayValue(a,($_=new JsonParser_$90(this.errors,this.putils,2),$bind($_,$_.loadJson)),variable);
+ }
+ ,__class__: JsonParser_$89
});
var JsonParser_$9 = function(errors,putils,errorType) {
if(errorType == null) {
@@ -2040,7 +2434,7 @@ JsonParser_$9.prototype = $extend(json2object_reader_BaseParser.prototype,{
var field = o[_g];
++_g;
if(field.name == "data") {
- this.value.data = this.loadObjectField(($_=new JsonParser_$42(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"data",assigned,this.value.data,pos);
+ this.value.data = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"data",assigned,this.value.data,pos);
} else {
this.errors.push(json2object_Error.UnknownVariable(field.name,this.putils.convertPosition(field.namePos)));
}
@@ -2048,10 +2442,122 @@ JsonParser_$9.prototype = $extend(json2object_reader_BaseParser.prototype,{
this.objectErrors(assigned,pos);
}
,getAuto: function() {
- return { data : new JsonParser_$42([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
+ return { data : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
}
,__class__: JsonParser_$9
});
+var JsonParser_$90 = function(errors,putils,errorType) {
+ if(errorType == null) {
+ errorType = 0;
+ }
+ json2object_reader_BaseParser.call(this,errors,putils,errorType);
+};
+JsonParser_$90.__name__ = true;
+JsonParser_$90.__super__ = json2object_reader_BaseParser;
+JsonParser_$90.prototype = $extend(json2object_reader_BaseParser.prototype,{
+ onIncorrectType: function(pos,variable) {
+ this.value = "guest";
+ this.errors.push(json2object_Error.IncorrectType(variable,"Permission",pos));
+ this.objectThrow(pos,variable);
+ }
+ ,loadJsonNull: function(pos,variable) {
+ this.value = null;
+ }
+ ,loadJsonString: function(s,pos,variable) {
+ this.value = this.loadString(s,pos,variable,["guest","user","leader","admin","writeChat","addVideo","removeVideo","requestLeader","rewind","clearChat","setLeader","changeOrder","toggleItemType","lockPlaylist","banClient"],"guest");
+ }
+ ,__class__: JsonParser_$90
+});
+var JsonParser_$92 = function(errors,putils,errorType) {
+ if(errorType == null) {
+ errorType = 0;
+ }
+ json2object_reader_BaseParser.call(this,errors,putils,errorType);
+};
+JsonParser_$92.__name__ = true;
+JsonParser_$92.__super__ = json2object_reader_BaseParser;
+JsonParser_$92.prototype = $extend(json2object_reader_BaseParser.prototype,{
+ onIncorrectType: function(pos,variable) {
+ this.errors.push(json2object_Error.IncorrectType(variable,"{ replace : String, regex : String, name : String, flags : String }",pos));
+ json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
+ }
+ ,loadJsonNull: function(pos,variable) {
+ this.value = null;
+ }
+ ,loadJsonObject: function(o,pos,variable) {
+ var assigned = new haxe_ds_StringMap();
+ this.objectSetupAssign(assigned,["flags","name","regex","replace"],[false,false,false,false]);
+ this.value = this.getAuto();
+ var _g = 0;
+ while(_g < o.length) {
+ var field = o[_g];
+ ++_g;
+ switch(field.name) {
+ case "flags":
+ this.value.flags = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"flags",assigned,this.value.flags,pos);
+ break;
+ case "name":
+ this.value.name = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"name",assigned,this.value.name,pos);
+ break;
+ case "regex":
+ this.value.regex = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"regex",assigned,this.value.regex,pos);
+ break;
+ case "replace":
+ this.value.replace = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"replace",assigned,this.value.replace,pos);
+ break;
+ default:
+ this.errors.push(json2object_Error.UnknownVariable(field.name,this.putils.convertPosition(field.namePos)));
+ }
+ }
+ this.objectErrors(assigned,pos);
+ }
+ ,getAuto: function() {
+ return { flags : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), name : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), regex : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), replace : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
+ }
+ ,__class__: JsonParser_$92
+});
+var JsonParser_$94 = function(errors,putils,errorType) {
+ if(errorType == null) {
+ errorType = 0;
+ }
+ json2object_reader_BaseParser.call(this,errors,putils,errorType);
+};
+JsonParser_$94.__name__ = true;
+JsonParser_$94.__super__ = json2object_reader_BaseParser;
+JsonParser_$94.prototype = $extend(json2object_reader_BaseParser.prototype,{
+ onIncorrectType: function(pos,variable) {
+ this.errors.push(json2object_Error.IncorrectType(variable,"{ name : String, image : String }",pos));
+ json2object_reader_BaseParser.prototype.onIncorrectType.call(this,pos,variable);
+ }
+ ,loadJsonNull: function(pos,variable) {
+ this.value = null;
+ }
+ ,loadJsonObject: function(o,pos,variable) {
+ var assigned = new haxe_ds_StringMap();
+ this.objectSetupAssign(assigned,["image","name"],[false,false]);
+ this.value = this.getAuto();
+ var _g = 0;
+ while(_g < o.length) {
+ var field = o[_g];
+ ++_g;
+ switch(field.name) {
+ case "image":
+ this.value.image = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"image",assigned,this.value.image,pos);
+ break;
+ case "name":
+ this.value.name = this.loadObjectField(($_=new JsonParser_$44(this.errors,this.putils,1),$bind($_,$_.loadJson)),field,"name",assigned,this.value.name,pos);
+ break;
+ default:
+ this.errors.push(json2object_Error.UnknownVariable(field.name,this.putils.convertPosition(field.namePos)));
+ }
+ }
+ this.objectErrors(assigned,pos);
+ }
+ ,getAuto: function() {
+ return { image : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1))), name : new JsonParser_$44([],this.putils,0).loadJson(new hxjsonast_Json(hxjsonast_JsonValue.JNull,new hxjsonast_Position("",0,1)))};
+ }
+ ,__class__: JsonParser_$94
+});
var Lambda = function() { };
Lambda.__name__ = true;
Lambda.exists = function(it,f) {
@@ -3350,6 +3856,7 @@ var js_node_Os = require("os");
var js_node_Path = require("path");
var js_node_Readline = require("readline");
var js_node_url_URL = require("url").URL;
+var js_node_url_URLSearchParams = require("url").URLSearchParams;
var js_npm_ws_Server = require("ws").Server;
var json2object_Error = $hxEnums["json2object.Error"] = { __ename__:true,__constructs__:null
,IncorrectType: ($_=function(variable,expected,pos) { return {_hx_index:0,variable:variable,expected:expected,pos:pos,__enum__:"json2object.Error",toString:$estr}; },$_._hx_name="IncorrectType",$_.__params__ = ["variable","expected","pos"],$_)
@@ -3822,12 +4329,12 @@ server_HttpServer.localizeHtml = function(data,lang) {
};
server_HttpServer.proxyUrl = function(req,res) {
var url = StringTools.replace(req.url,"/proxy?url=","");
- var proxy = server_HttpServer.proxyRequest(url,req,res,function(proxyReq) {
- var tmp = proxyReq.headers["location"];
+ var proxy = server_HttpServer.proxyRequest(url,req,res,function(proxyRes) {
+ var tmp = proxyRes.headers["location"];
if(tmp == null) {
return false;
}
- var proxy2 = server_HttpServer.proxyRequest(tmp,req,res,function(proxyReq) {
+ var proxy2 = server_HttpServer.proxyRequest(tmp,req,res,function(proxyRes) {
return false;
});
if(proxy2 == null) {
@@ -3843,7 +4350,7 @@ server_HttpServer.proxyUrl = function(req,res) {
req.pipe(proxy);
return true;
};
-server_HttpServer.proxyRequest = function(url,req,res,fn) {
+server_HttpServer.proxyRequest = function(url,req,res,cancelProxyRequest) {
var url1;
try {
url1 = new js_node_url_URL(server_HttpServer.safeDecodeURI(url));
@@ -3854,14 +4361,16 @@ server_HttpServer.proxyRequest = function(url,req,res,fn) {
return null;
}
var options = { host : url1.hostname, port : Std.parseInt(url1.port), path : url1.pathname + url1.search, method : req.method};
+ req.headers["referer"] = url1.toString();
+ req.headers["host"] = url1.hostname;
var request = url1.protocol == "https:" ? js_node_Https.request : js_node_Http.request;
- var proxy = request(options,function(proxyReq) {
- if(fn(proxyReq)) {
+ var proxy = request(options,function(proxyRes) {
+ if(cancelProxyRequest(proxyRes)) {
return;
}
- proxyReq.headers["Content-Type"] = "application/octet-stream";
- res.writeHead(proxyReq.statusCode,proxyReq.headers);
- proxyReq.pipe(res);
+ proxyRes.headers["Content-Type"] = "application/octet-stream";
+ res.writeHead(proxyRes.statusCode,proxyRes.headers);
+ proxyRes.pipe(res);
});
proxy.on("error",function(err) {
res.end("Proxy error: " + url1.href);
@@ -4574,6 +5083,12 @@ server_Main.prototype = {
}
this.send(client,obj);
break;
+ case "GetYoutubeVideoInfo":
+ var url = data.getYoutubeVideoInfo.url;
+ server_YoutubeFallback.getInfo(url,function(info) {
+ _gthis.send(client,{ type : data.type, getYoutubeVideoInfo : { url : url, response : info}});
+ });
+ break;
case "KickClient":
if(!this.checkPermission(client,"banClient")) {
return;
@@ -4618,7 +5133,7 @@ server_Main.prototype = {
this.send(client,{ type : "LoginError"});
return;
}
- haxe_Log.trace(HxOverrides.dateStr(new Date()),{ fileName : "src/server/Main.hx", lineNumber : 541, className : "server.Main", methodName : "onMessage", customParams : ["Client " + client.name + " logged as " + name]});
+ haxe_Log.trace(HxOverrides.dateStr(new Date()),{ fileName : "src/server/Main.hx", lineNumber : 540, className : "server.Main", methodName : "onMessage", customParams : ["Client " + client.name + " logged as " + name]});
client.name = name;
client.setGroupFlag(ClientGroup.User,true);
this.checkBan(client);
@@ -4631,7 +5146,7 @@ server_Main.prototype = {
var oldName = client.name;
client.name = "Guest " + (this.clients.indexOf(client) + 1);
client.setGroupFlag(ClientGroup.User,false);
- haxe_Log.trace(HxOverrides.dateStr(new Date()),{ fileName : "src/server/Main.hx", lineNumber : 562, className : "server.Main", methodName : "onMessage", customParams : ["Client " + oldName + " logout to " + client.name]});
+ haxe_Log.trace(HxOverrides.dateStr(new Date()),{ fileName : "src/server/Main.hx", lineNumber : 561, className : "server.Main", methodName : "onMessage", customParams : ["Client " + oldName + " logout to " + client.name]});
this.send(client,{ type : data.type, logout : { oldClientName : oldName, clientName : client.name, clients : this.clientList()}});
this.sendClientListExcept(client);
break;
@@ -4711,15 +5226,15 @@ server_Main.prototype = {
if(this.videoList.items.length == 0) {
return;
}
- var url = data.removeVideo.url;
+ var url1 = data.removeVideo.url;
var index = this.videoList.findIndex(function(item) {
- return item.url == url;
+ return item.url == url1;
});
if(index == -1) {
return;
}
var _this = this.videoList;
- var isCurrent = _this.items[_this.pos].url == url;
+ var isCurrent = _this.items[_this.pos].url == url1;
if(isCurrent && this.videoTimer.getTime() > 30) {
var _this = this.videoList;
this.saveFlashbackTime(_this.items[_this.pos]);
@@ -4946,7 +5461,7 @@ server_Main.prototype = {
client.setGroupFlag(ClientGroup.Banned,!isOutdated);
if(isOutdated) {
HxOverrides.remove(this.userList.bans,ban);
- haxe_Log.trace("" + client.name + " ban removed",{ fileName : "src/server/Main.hx", lineNumber : 961, className : "server.Main", methodName : "checkBan"});
+ haxe_Log.trace("" + client.name + " ban removed",{ fileName : "src/server/Main.hx", lineNumber : 971, className : "server.Main", methodName : "checkBan"});
this.sendClientList();
}
break;
@@ -5246,6 +5761,166 @@ server_VideoTimer.prototype = {
}
,__class__: server_VideoTimer
};
+var server_YoutubeFallback = function() { };
+server_YoutubeFallback.__name__ = true;
+server_YoutubeFallback.httpsGet = function(url,options,callback) {
+ var request = js_node_Https.get(url,options,function(res) {
+ var data = "";
+ res.on("data",function(chunk) {
+ data += chunk.toString();
+ return data;
+ });
+ res.on("end",function() {
+ callback(res.statusCode,data);
+ });
+ });
+ request.on("error",function(err) {
+ haxe_Log.trace(url,{ fileName : "src/server/YoutubeFallback.hx", lineNumber : 26, className : "server.YoutubeFallback", methodName : "httpsGet"});
+ haxe_Log.trace("request error: ",{ fileName : "src/server/YoutubeFallback.hx", lineNumber : 27, className : "server.YoutubeFallback", methodName : "httpsGet", customParams : [err]});
+ });
+};
+server_YoutubeFallback.resolvePlayerResponse = function(watchHtml) {
+ if(watchHtml == null) {
+ return "";
+ }
+ var resReg = new EReg("ytInitialPlayerResponse = (.*)}}};","");
+ if(resReg.match(watchHtml)) {
+ return resReg.matched(1) + "}}}";
+ } else {
+ return "";
+ }
+};
+server_YoutubeFallback.resoleM3U8Link = function(watchHtml) {
+ if(watchHtml == null) {
+ return null;
+ }
+ var hlsReg = new EReg("hlsManifestUrl\":\"(.*/file/index\\.m3u8)","");
+ if(hlsReg.match(watchHtml)) {
+ return hlsReg.matched(1);
+ } else {
+ return null;
+ }
+};
+server_YoutubeFallback.buildDecoder = function(watchHtml,callback) {
+ if(watchHtml == null) {
+ callback(null);
+ return;
+ }
+ var jsFileUrlReg = new EReg("/s/player/[A-Za-z0-9]+/[A-Za-z0-9_.]+/[A-Za-z0-9_]+/base\\.js","");
+ if(!jsFileUrlReg.match(watchHtml)) {
+ callback(null);
+ return;
+ }
+ var url = "https://www.youtube.com" + jsFileUrlReg.matched(0);
+ server_YoutubeFallback.httpsGet(url,{ },function(status,jsFileContent) {
+ var funcReg = new EReg("function.*\\.split\\(\"\"\\).*\\.join\\(\"\"\\)}","");
+ if(!funcReg.match(jsFileContent)) {
+ callback(null);
+ return;
+ }
+ var decodeFunction = funcReg.matched(0);
+ var varNameReg = new EReg("\\.split\\(\"\"\\);([a-zA-Z0-9]+)\\.","i");
+ if(!varNameReg.match(decodeFunction)) {
+ callback(null);
+ return;
+ }
+ var varStartIndex = jsFileContent.indexOf("var " + varNameReg.matched(1) + "={");
+ if(varStartIndex < 0) {
+ callback(null);
+ return;
+ }
+ var varEndIndex = jsFileContent.indexOf("}};",varStartIndex);
+ if(varEndIndex < 0) {
+ callback(null);
+ return;
+ }
+ var varDeclares = jsFileContent.substring(varStartIndex,varEndIndex + 3);
+ if(varDeclares.length == 0) {
+ callback(null);
+ return;
+ }
+ callback(function(signatureCipher) {
+ var params = new js_node_url_URLSearchParams(signatureCipher);
+ var obj = Object.fromEntries(params);
+ var signature = obj.s;
+ var tmp = obj.sp;
+ var signatureParam = tmp != null ? tmp : "signature";
+ var url = obj.url;
+ var decodedSignature = new Function("\n\t\t\t\t\t\"use strict\";\n\t\t\t\t\t" + varDeclares + "\n\t\t\t\t\treturn (" + decodeFunction + ")(\"" + signature + "\");\n\t\t\t\t").call(null);
+ return "" + url + "&" + signatureParam + "=" + encodeURIComponent(decodedSignature);
+ });
+ });
+};
+server_YoutubeFallback.getInfo = function(url,callback) {
+ var videoId = utils_YoutubeUtils.extractVideoId(url);
+ if(videoId.length == 0) {
+ haxe_Log.trace("youtube videoId is not found",{ fileName : "src/server/YoutubeFallback.hx", lineNumber : 87, className : "server.YoutubeFallback", methodName : "getInfo"});
+ callback(null);
+ return;
+ }
+ server_YoutubeFallback.httpsGet("https://www.youtube.com/watch?v=" + videoId,{ },function(status,data) {
+ if(status != 200 || data.length == 0) {
+ haxe_Log.trace("Cannot get youtube video response",{ fileName : "src/server/YoutubeFallback.hx", lineNumber : 94, className : "server.YoutubeFallback", methodName : "getInfo"});
+ callback(null);
+ return;
+ }
+ var parsedResponse = JSON.parse(server_YoutubeFallback.resolvePlayerResponse(data));
+ var tmp = parsedResponse.streamingData;
+ var streamingData = tmp != null ? tmp : { };
+ streamingData.formats = streamingData.formats != null ? streamingData.formats : [];
+ streamingData.adaptiveFormats = streamingData.adaptiveFormats != null ? streamingData.adaptiveFormats : [];
+ var formats = streamingData.formats.concat(streamingData.adaptiveFormats);
+ var promises = [];
+ if(Lambda.exists(formats,function(it) {
+ return it.signatureCipher != null;
+ })) {
+ var promise = new Promise(function(resolve,reject) {
+ server_YoutubeFallback.buildDecoder(data,function(decoder) {
+ if(decoder != null) {
+ var result = new Array(formats.length);
+ var _g = 0;
+ var _g1 = formats.length;
+ while(_g < _g1) {
+ var i = _g++;
+ var item = formats[i];
+ var formats1;
+ if(item.url != null || item.signatureCipher == null) {
+ formats1 = item;
+ } else {
+ item.url = decoder(item.signatureCipher);
+ item.signatureCipher = null;
+ formats1 = item;
+ }
+ result[i] = formats1;
+ }
+ formats = result;
+ }
+ resolve(null);
+ });
+ });
+ promises.push(promise);
+ }
+ Promise.all(promises).then(function(_) {
+ var tmp = parsedResponse.videoDetails;
+ var result = tmp != null ? tmp : { };
+ var _g = [];
+ var _g1 = 0;
+ var _g2 = formats;
+ while(_g1 < _g2.length) {
+ var v = _g2[_g1];
+ ++_g1;
+ if(v.url != null) {
+ _g.push(v);
+ }
+ }
+ var result1 = { videoDetails : result, formats : _g};
+ if(result1.videoDetails.isLiveContent) {
+ result1.liveData = { manifestUrl : server_YoutubeFallback.resoleM3U8Link(data)};
+ }
+ callback(result1);
+ });
+ });
+};
var sys_FileSystem = function() { };
sys_FileSystem.__name__ = true;
sys_FileSystem.exists = function(path) {
@@ -5284,6 +5959,23 @@ sys_FileSystem.createDirectory = function(path) {
}
}
};
+var utils_YoutubeUtils = function() { };
+utils_YoutubeUtils.__name__ = true;
+utils_YoutubeUtils.extractVideoId = function(url) {
+ if(utils_YoutubeUtils.matchId.match(url)) {
+ return utils_YoutubeUtils.matchId.matched(1);
+ }
+ if(utils_YoutubeUtils.matchShort.match(url)) {
+ return utils_YoutubeUtils.matchShort.matched(1);
+ }
+ if(utils_YoutubeUtils.matchShorts.match(url)) {
+ return utils_YoutubeUtils.matchShorts.matched(1);
+ }
+ if(utils_YoutubeUtils.matchEmbed.match(url)) {
+ return utils_YoutubeUtils.matchEmbed.matched(1);
+ }
+ return "";
+};
function $getIterator(o) { if( o instanceof Array ) return new haxe_iterators_ArrayIterator(o); else return o.iterator(); }
function $bind(o,m) { if( m == null ) return null; if( m.__id__ == null ) m.__id__ = $global.$haxeUID++; var f; if( o.hx__closures__ == null ) o.hx__closures__ = {}; else f = o.hx__closures__[m.__id__]; if( f == null ) { f = m.bind(o); o.hx__closures__[m.__id__] = f; } return f; }
$global.$haxeUID |= 0;
@@ -5342,5 +6034,9 @@ server_HttpServer.CHUNK_SIZE = 5242880;
server_HttpServer.matchLang = new EReg("^[A-z]+","");
server_HttpServer.matchVarString = new EReg("\\${([A-z_]+)}","g");
server_HttpServer.ctrlCharacters = new EReg("[\\u0000-\\u001F\\u007F-\\u009F\\u2000-\\u200D\\uFEFF]","g");
+utils_YoutubeUtils.matchId = new EReg("youtube\\.com.*v=([A-z0-9_-]+)","");
+utils_YoutubeUtils.matchShort = new EReg("youtu\\.be/([A-z0-9_-]+)","");
+utils_YoutubeUtils.matchShorts = new EReg("youtube\\.com/shorts/([A-z0-9_-]+)","");
+utils_YoutubeUtils.matchEmbed = new EReg("youtube\\.com/embed/([A-z0-9_-]+)","");
server_Main.main();
})(typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this);
diff --git a/hxformat.json b/hxformat.json
index 458fcbf..89bf1e2 100644
--- a/hxformat.json
+++ b/hxformat.json
@@ -22,7 +22,7 @@
},
"methodChain": {
"rules": []
- },
+ }
},
"emptyLines": {
"beforeDocCommentEmptyLines": "ignore",
diff --git a/res/client.js b/res/client.js
index cd3157e..48bf37c 100644
--- a/res/client.js
+++ b/res/client.js
@@ -1576,13 +1576,19 @@ client_Main.prototype = {
if(this.host == this.globalIp) {
return url;
}
- return StringTools.replace(url,this.globalIp,this.host);
+ try {
+ var url1 = new URL(url);
+ url1.hostname = StringTools.replace(url1.hostname,this.globalIp,this.host);
+ return "" + Std.string(url1);
+ } catch( _g ) {
+ return url;
+ }
}
,onMessage: function(e) {
var data = JSON.parse(e.data);
if(this.config != null && this.config.isVerbose) {
var t = data.type;
- haxe_Log.trace("Event: " + data.type,{ fileName : "src/client/Main.hx", lineNumber : 398, className : "client.Main", methodName : "onMessage", customParams : [Reflect.field(data,t.charAt(0).toLowerCase() + HxOverrides.substr(t,1,null))]});
+ haxe_Log.trace("Event: " + data.type,{ fileName : "src/client/Main.hx", lineNumber : 405, className : "client.Main", methodName : "onMessage", customParams : [Reflect.field(data,t.charAt(0).toLowerCase() + HxOverrides.substr(t,1,null))]});
}
client_JsApi.fireOnceEvent(data);
switch(data.type) {
@@ -1651,6 +1657,8 @@ client_Main.prototype = {
this.player.setTime(newTime);
}
break;
+ case "GetYoutubeVideoInfo":
+ break;
case "KickClient":
this.disabledReconnection = true;
this.ws.close();
@@ -2367,6 +2375,10 @@ client_Player.prototype = {
var el = this.videoItemsEl.children[pos];
this.setItemElementType(el,this.videoList.items[pos].isTemp);
}
+ ,getCurrentItem: function() {
+ var _this = this.videoList;
+ return _this.items[_this.pos];
+ }
,setPlayer: function(newPlayer) {
if(this.player != newPlayer) {
if(this.player != null) {
@@ -2798,7 +2810,7 @@ client_Player.prototype = {
}
};
http.onError = function(msg) {
- haxe_Log.trace(msg,{ fileName : "src/client/Player.hx", lineNumber : 478, className : "client.Player", methodName : "skipAd"});
+ haxe_Log.trace(msg,{ fileName : "src/client/Player.hx", lineNumber : 482, className : "client.Player", methodName : "skipAd"});
};
http.request();
}
@@ -3490,11 +3502,6 @@ var client_players_Youtube = function(main,player) {
this.urlTitleDuration = "?part=snippet,contentDetails&fields=items(snippet/title,contentDetails/duration)";
this.playlistUrl = "https://www.googleapis.com/youtube/v3/playlistItems";
this.videosUrl = "https://www.googleapis.com/youtube/v3/videos";
- this.matchPlaylist = new EReg("youtube\\.com.*list=([A-z0-9_-]+)","");
- this.matchEmbed = new EReg("youtube\\.com/embed/([A-z0-9_-]+)","");
- this.matchShorts = new EReg("youtube\\.com/shorts/([A-z0-9_-]+)","");
- this.matchShort = new EReg("youtu\\.be/([A-z0-9_-]+)","");
- this.matchId = new EReg("youtube\\.com.*v=([A-z0-9_-]+)","");
this.main = main;
this.player = player;
};
@@ -3508,25 +3515,10 @@ client_players_Youtube.prototype = {
}
}
,extractVideoId: function(url) {
- if(this.matchId.match(url)) {
- return this.matchId.matched(1);
- }
- if(this.matchShort.match(url)) {
- return this.matchShort.matched(1);
- }
- if(this.matchShorts.match(url)) {
- return this.matchShorts.matched(1);
- }
- if(this.matchEmbed.match(url)) {
- return this.matchEmbed.matched(1);
- }
- return "";
+ return utils_YoutubeUtils.extractVideoId(url);
}
,extractPlaylistId: function(url) {
- if(!this.matchPlaylist.match(url)) {
- return "";
- }
- return this.matchPlaylist.matched(1);
+ return utils_YoutubeUtils.extractPlaylistId(url);
}
,convertTime: function(duration) {
var total = 0;
@@ -3652,7 +3644,7 @@ client_players_Youtube.prototype = {
}
callback({ duration : _gthis.tempYoutube.getDuration()});
}, onError : function(e) {
- haxe_Log.trace("Error " + e.data,{ fileName : "src/client/players/Youtube.hx", lineNumber : 205, className : "client.players.Youtube", methodName : "getRemoteDataFallback"});
+ haxe_Log.trace("Error " + e.data,{ fileName : "src/client/players/Youtube.hx", lineNumber : 188, className : "client.players.Youtube", methodName : "getRemoteDataFallback"});
if(_gthis.playerEl.contains(video)) {
_gthis.playerEl.removeChild(video);
}
@@ -3699,8 +3691,51 @@ client_players_Youtube.prototype = {
}
}, onPlaybackRateChange : function(e) {
_gthis.player.onRateChange();
+ }, onError : function(e) {
+ haxe_Log.trace("Error " + e.data,{ fileName : "src/client/players/Youtube.hx", lineNumber : 245, className : "client.players.Youtube", methodName : "loadVideo"});
+ _gthis.rawSourceFallback(item.url);
}}});
}
+ ,rawSourceFallback: function(url) {
+ var _gthis = this;
+ client_JsApi.once("GetYoutubeVideoInfo",function(event) {
+ var info = event.getYoutubeVideoInfo.response;
+ var tmp = _gthis.getBestStreamFormat(info);
+ if(tmp == null) {
+ haxe_Log.trace("format not found in response info:",{ fileName : "src/client/players/Youtube.hx", lineNumber : 257, className : "client.players.Youtube", methodName : "rawSourceFallback"});
+ haxe_Log.trace(info,{ fileName : "src/client/players/Youtube.hx", lineNumber : 258, className : "client.players.Youtube", methodName : "rawSourceFallback"});
+ return;
+ }
+ _gthis.player.getCurrentItem().url = tmp.url;
+ _gthis.player.refresh();
+ });
+ this.main.send({ type : "GetYoutubeVideoInfo", getYoutubeVideoInfo : { url : url}});
+ }
+ ,getBestStreamFormat: function(info) {
+ info.formats = info.formats != null ? info.formats : [];
+ info.adaptiveFormats = info.adaptiveFormats != null ? info.adaptiveFormats : [];
+ var formats = info.adaptiveFormats.concat(info.formats);
+ var qPriority = [1080,720,480,360,240];
+ var _g = 0;
+ while(_g < qPriority.length) {
+ var quality = "" + qPriority[_g++] + "p";
+ var _g1 = 0;
+ while(_g1 < formats.length) {
+ var format = formats[_g1];
+ ++_g1;
+ if(format.audioQuality == null) {
+ continue;
+ }
+ if(format.width == null) {
+ continue;
+ }
+ if(format.qualityLabel == quality) {
+ return format;
+ }
+ }
+ }
+ return null;
+ }
,removeVideo: function() {
if(this.video == null) {
return;
@@ -4515,6 +4550,29 @@ js_youtube_Youtube.init = function(onAPIReady) {
}
};
};
+var utils_YoutubeUtils = function() { };
+utils_YoutubeUtils.__name__ = true;
+utils_YoutubeUtils.extractVideoId = function(url) {
+ if(utils_YoutubeUtils.matchId.match(url)) {
+ return utils_YoutubeUtils.matchId.matched(1);
+ }
+ if(utils_YoutubeUtils.matchShort.match(url)) {
+ return utils_YoutubeUtils.matchShort.matched(1);
+ }
+ if(utils_YoutubeUtils.matchShorts.match(url)) {
+ return utils_YoutubeUtils.matchShorts.matched(1);
+ }
+ if(utils_YoutubeUtils.matchEmbed.match(url)) {
+ return utils_YoutubeUtils.matchEmbed.matched(1);
+ }
+ return "";
+};
+utils_YoutubeUtils.extractPlaylistId = function(url) {
+ if(!utils_YoutubeUtils.matchPlaylist.match(url)) {
+ return "";
+ }
+ return utils_YoutubeUtils.matchPlaylist.matched(1);
+};
function $getIterator(o) { if( o instanceof Array ) return new haxe_iterators_ArrayIterator(o); else return o.iterator(); }
function $bind(o,m) { if( m == null ) return null; if( m.__id__ == null ) m.__id__ = $global.$haxeUID++; var f; if( o.hx__closures__ == null ) o.hx__closures__ = {}; else f = o.hx__closures__[m.__id__]; if( f == null ) { f = m.bind(o); o.hx__closures__[m.__id__] = f; } return f; }
$global.$haxeUID |= 0;
@@ -4538,5 +4596,10 @@ client_players_RawSubs.assTimeStamp = new EReg("([0-9]+):([0-9][0-9]):([0-9][0-9
haxe_crypto_Base64.CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
haxe_crypto_Base64.BYTES = haxe_io_Bytes.ofString(haxe_crypto_Base64.CHARS);
js_youtube_Youtube.isLoadedAPI = false;
+utils_YoutubeUtils.matchId = new EReg("youtube\\.com.*v=([A-z0-9_-]+)","");
+utils_YoutubeUtils.matchShort = new EReg("youtu\\.be/([A-z0-9_-]+)","");
+utils_YoutubeUtils.matchShorts = new EReg("youtube\\.com/shorts/([A-z0-9_-]+)","");
+utils_YoutubeUtils.matchEmbed = new EReg("youtube\\.com/embed/([A-z0-9_-]+)","");
+utils_YoutubeUtils.matchPlaylist = new EReg("youtube\\.com.*list=([A-z0-9_-]+)","");
client_Main.main();
})(typeof exports != "undefined" ? exports : typeof window != "undefined" ? window : typeof self != "undefined" ? self : this, typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this);
diff --git a/src/Types.hx b/src/Types.hx
index 4ef233b..eeae641 100644
--- a/src/Types.hx
+++ b/src/Types.hx
@@ -1,6 +1,7 @@
package;
import Client.ClientData;
+import utils.YoutubeUtils.YouTubeVideoInfo;
typedef VideoDataRequest = {
url:String,
@@ -204,6 +205,10 @@ typedef WsEvent = {
},
?dump:{
data:String
+ },
+ ?getYoutubeVideoInfo:{
+ url:String,
+ ?response:YouTubeVideoInfo
}
}
@@ -242,4 +247,5 @@ enum abstract WsEventType(String) {
var UpdatePlaylist;
var TogglePlaylistLock;
var Dump;
+ var GetYoutubeVideoInfo;
}
diff --git a/src/client/Main.hx b/src/client/Main.hx
index b1e0eb6..85db713 100644
--- a/src/client/Main.hx
+++ b/src/client/Main.hx
@@ -18,6 +18,7 @@ import js.html.Event;
import js.html.InputElement;
import js.html.KeyboardEvent;
import js.html.MouseEvent;
+import js.html.URL;
import js.html.VideoElement;
import js.html.WebSocket;
@@ -387,7 +388,13 @@ class Main {
public function tryLocalIp(url:String):String {
if (host == globalIp) return url;
- return url.replace(globalIp, host);
+ try {
+ final url = new URL(url);
+ url.hostname = url.hostname.replace(globalIp, host);
+ return '$url';
+ } catch (e) {
+ return url;
+ }
}
function onMessage(e):Void {
@@ -557,6 +564,9 @@ class Main {
case Dump:
Utils.saveFile("dump.json", ApplicationJson, data.dump.data);
+
+ case GetYoutubeVideoInfo:
+ // handled by event listeners like `JsApi.once`
}
}
diff --git a/src/client/Player.hx b/src/client/Player.hx
index 75b44b5..06a8f3e 100644
--- a/src/client/Player.hx
+++ b/src/client/Player.hx
@@ -89,6 +89,10 @@ class Player {
setItemElementType(el, videoList.getItem(pos).isTemp);
}
+ public function getCurrentItem():VideoItem {
+ return videoList.currentItem;
+ }
+
function setPlayer(newPlayer:IPlayer):Void {
if (player != newPlayer) {
if (player != null) {
diff --git a/src/client/players/Youtube.hx b/src/client/players/Youtube.hx
index a728012..5308b63 100644
--- a/src/client/players/Youtube.hx
+++ b/src/client/players/Youtube.hx
@@ -10,15 +10,11 @@ import js.Browser.document;
import js.html.Element;
import js.youtube.Youtube as YtInit;
import js.youtube.YoutubePlayer;
+import utils.YoutubeUtils;
using StringTools;
class Youtube implements IPlayer {
- final matchId = ~/youtube\.com.*v=([A-z0-9_-]+)/;
- final matchShort = ~/youtu\.be\/([A-z0-9_-]+)/;
- final matchShorts = ~/youtube\.com\/shorts\/([A-z0-9_-]+)/;
- final matchEmbed = ~/youtube\.com\/embed\/([A-z0-9_-]+)/;
- final matchPlaylist = ~/youtube\.com.*list=([A-z0-9_-]+)/;
final videosUrl = "https://www.googleapis.com/youtube/v3/videos";
final playlistUrl = "https://www.googleapis.com/youtube/v3/playlistItems";
final urlTitleDuration = "?part=snippet,contentDetails&fields=items(snippet/title,contentDetails/duration)";
@@ -41,25 +37,12 @@ class Youtube implements IPlayer {
return extractVideoId(url) != "" || extractPlaylistId(url) != "";
}
- public function extractVideoId(url:String):String {
- if (matchId.match(url)) {
- return matchId.matched(1);
- }
- if (matchShort.match(url)) {
- return matchShort.matched(1);
- }
- if (matchShorts.match(url)) {
- return matchShorts.matched(1);
- }
- if (matchEmbed.match(url)) {
- return matchEmbed.matched(1);
- }
- return "";
+ public function extractVideoId(url:String) {
+ return YoutubeUtils.extractVideoId(url);
}
- function extractPlaylistId(url:String):String {
- if (!matchPlaylist.match(url)) return "";
- return matchPlaylist.matched(1);
+ public function extractPlaylistId(url:String) {
+ return YoutubeUtils.extractPlaylistId(url);
}
final matchHours = ~/([0-9]+)H/;
@@ -256,11 +239,53 @@ class Youtube implements IPlayer {
},
onPlaybackRateChange: e -> {
player.onRateChange();
+ },
+ onError: e -> {
+ // TODO message error codes
+ trace('Error ${e.data}');
+ rawSourceFallback(item.url);
}
}
});
}
+ function rawSourceFallback(url:String):Void {
+ JsApi.once(GetYoutubeVideoInfo, event -> {
+ final data = event.getYoutubeVideoInfo;
+ final info = data.response;
+ final format = getBestStreamFormat(info) ?? {
+ trace("format not found in response info:");
+ trace(info);
+ return;
+ };
+ final item = player.getCurrentItem();
+ item.url = format.url;
+ player.refresh();
+ });
+ main.send({
+ type: GetYoutubeVideoInfo,
+ getYoutubeVideoInfo: {
+ url: url
+ }
+ });
+ }
+
+ function getBestStreamFormat(info:YouTubeVideoInfo):Null<YoutubeVideoFormat> {
+ info.formats ??= [];
+ info.adaptiveFormats ??= [];
+ final formats = info.adaptiveFormats.concat(info.formats);
+ final qPriority = [1080, 720, 480, 360, 240];
+ for (q in qPriority) {
+ final quality = '${q}p';
+ for (format in formats) {
+ if (format.audioQuality == null) continue; // no sound
+ if (format.width == null) continue; // no video
+ if (format.qualityLabel == quality) return format;
+ }
+ }
+ return null;
+ }
+
public function removeVideo():Void {
if (video == null) return;
isLoaded = false;
diff --git a/src/server/HttpServer.hx b/src/server/HttpServer.hx
index c953bb0..1a0c4d5 100644
--- a/src/server/HttpServer.hx
+++ b/src/server/HttpServer.hx
@@ -187,9 +187,9 @@ class HttpServer {
static function proxyUrl(req:IncomingMessage, res:ServerResponse):Bool {
final url = req.url.replace("/proxy?url=", "");
- final proxy = proxyRequest(url, req, res, proxyReq -> {
- final url = proxyReq.headers["location"] ?? return false;
- final proxy2 = proxyRequest(url, req, res, proxyReq -> false);
+ final proxy = proxyRequest(url, req, res, proxyRes -> {
+ final url = proxyRes.headers["location"] ?? return false;
+ final proxy2 = proxyRequest(url, req, res, proxyRes -> false);
if (proxy2 == null) {
res.end('Proxy error: multiple redirects for url $url');
return true;
@@ -203,8 +203,10 @@ class HttpServer {
}
static function proxyRequest(
- url:String, req:IncomingMessage, res:ServerResponse,
- fn:(req:IncomingMessage) -> Bool
+ url:String,
+ req:IncomingMessage,
+ res:ServerResponse,
+ cancelProxyRequest:(proxyRes:IncomingMessage) -> Bool
):Null<ClientRequest> {
final url = try {
new URL(safeDecodeURI(url));
@@ -216,12 +218,14 @@ class HttpServer {
path: url.pathname + url.search,
method: req.method
};
+ req.headers["referer"] = url.toString();
+ req.headers["host"] = url.hostname;
final request = url.protocol == "https:" ? Https.request : Http.request;
- final proxy = request(options, proxyReq -> {
- if (fn(proxyReq)) return;
- proxyReq.headers["Content-Type"] = "application/octet-stream";
- res.writeHead(proxyReq.statusCode, proxyReq.headers);
- proxyReq.pipe(res);
+ final proxy = request(options, proxyRes -> {
+ if (cancelProxyRequest(proxyRes)) return;
+ proxyRes.headers["Content-Type"] = "application/octet-stream";
+ res.writeHead(proxyRes.statusCode, proxyRes.headers);
+ proxyRes.pipe(res);
});
proxy.on("error", err -> {
res.end('Proxy error: ${url.href}');
diff --git a/src/server/Main.hx b/src/server/Main.hx
index c5eb36f..e7c38a6 100644
--- a/src/server/Main.hx
+++ b/src/server/Main.hx
@@ -531,8 +531,7 @@ class Main {
if (userList.admins.exists(
a -> a.name.toLowerCase() == lcName && a.hash == hash)) {
client.isAdmin = true;
- }
- else {
+ } else {
serverMessage(client, "passwordMatchError");
send(client, {type: LoginError});
return;
@@ -587,6 +586,17 @@ class Main {
broadcast(data);
case ServerMessage:
+ case GetYoutubeVideoInfo:
+ final url = data.getYoutubeVideoInfo.url;
+ YoutubeFallback.getInfo(url, info -> {
+ send(client, {
+ type: data.type,
+ getYoutubeVideoInfo: {
+ url: url,
+ response: info
+ }
+ });
+ });
case AddVideo:
if (isPlaylistLockedFor(client)) return;
if (!checkPermission(client, AddVideoPerm)) return;
@@ -1038,7 +1048,9 @@ class Main {
duration: duration,
time: time
});
- while (flashbacks.length > FLASHBACKS_COUNT) flashbacks.pop();
+ while (flashbacks.length > FLASHBACKS_COUNT) {
+ flashbacks.pop();
+ }
}
function isPlaylistLockedFor(client:Client):Bool {
diff --git a/src/server/YoutubeFallback.hx b/src/server/YoutubeFallback.hx
new file mode 100644
index 0000000..34ea8a9
--- /dev/null
+++ b/src/server/YoutubeFallback.hx
@@ -0,0 +1,144 @@
+package server;
+
+import haxe.Json;
+import js.lib.Function;
+import js.lib.Object;
+import js.lib.Promise;
+import js.node.Https.Https;
+import js.node.Https.HttpsRequestOptions;
+import js.node.url.URLSearchParams;
+import utils.YoutubeUtils;
+
+using Lambda;
+
+class YoutubeFallback {
+ static function httpsGet(
+ url:String,
+ ?options:HttpsRequestOptions,
+ ?callback:(status:Int, data:String) -> Void
+ ):Void {
+ final request = Https.get(url, options, res -> {
+ var data = "";
+ res.on("data", chunk -> data += chunk.toString());
+ res.on("end", () -> callback(res.statusCode, data));
+ });
+ request.on("error", err -> {
+ trace(url);
+ trace("request error: ", err);
+ });
+ }
+
+ public static function resolvePlayerResponse(watchHtml:String):String {
+ if (watchHtml == null) return "";
+ final resReg = ~/ytInitialPlayerResponse = (.*)}}};/;
+ var matches = resReg.match(watchHtml);
+ return matches ? resReg.matched(1) + "}}}" : "";
+ }
+
+ public static function resoleM3U8Link(watchHtml:String):Null<String> {
+ if (watchHtml == null) return null;
+ final hlsReg = ~/hlsManifestUrl":"(.*\/file\/index\.m3u8)/;
+ return hlsReg.match(watchHtml) ? hlsReg.matched(1) : null;
+ }
+
+ public static function buildDecoder(watchHtml:String, callback:(decoder:(cipher:String) -> String) -> Void):Void {
+ if (watchHtml == null) return callback(null);
+
+ final jsFileUrlReg = ~/\/s\/player\/[A-Za-z0-9]+\/[A-Za-z0-9_.]+\/[A-Za-z0-9_]+\/base\.js/;
+ if (!jsFileUrlReg.match(watchHtml)) return callback(null);
+
+ final url = "https://www.youtube.com" + jsFileUrlReg.matched(0);
+ httpsGet(url, {}, (status, jsFileContent) -> {
+ final funcReg = ~/function.*\.split\(""\).*\.join\(""\)}/;
+ if (!funcReg.match(jsFileContent)) return callback(null);
+
+ final decodeFunction = funcReg.matched(0);
+ final varNameReg = ~/\.split\(""\);([a-zA-Z0-9]+)\./i;
+ if (!varNameReg.match(decodeFunction)) return callback(null);
+
+ final varStartIndex = jsFileContent.indexOf("var " + varNameReg.matched(1) + "={");
+ if (varStartIndex < 0) return callback(null);
+
+ final varEndIndex = jsFileContent.indexOf("}};", varStartIndex);
+ if (varEndIndex < 0) return callback(null);
+
+ final varDeclares = jsFileContent.substring(varStartIndex, varEndIndex + 3);
+ if (varDeclares.length == 0) return callback(null);
+
+ callback(signatureCipher -> {
+ final params = new URLSearchParams(signatureCipher);
+ final obj = Object.fromEntries(params);
+ final signature = obj.s;
+ final signatureParam = obj.sp ?? "signature";
+ final url = obj.url;
+ final decodedSignature = new Function('
+ "use strict";
+ $varDeclares
+ return ($decodeFunction)("$signature");
+ ').call(null);
+ return '$url&$signatureParam=${untyped encodeURIComponent(decodedSignature)}';
+ });
+ });
+ }
+
+ public static function getInfo(url:String, callback:(info:Null<YouTubeVideoInfo>) -> Void):Void {
+ final videoId = YoutubeUtils.extractVideoId(url);
+ if (videoId.length == 0) {
+ trace("youtube videoId is not found");
+ return callback(null);
+ }
+
+ final url = 'https://www.youtube.com/watch?v=$videoId';
+ httpsGet(url, {}, (status, data) -> {
+ if (status != 200 || data.length == 0) {
+ trace("Cannot get youtube video response");
+ return callback(null);
+ }
+
+ final ytInitialPlayerResponse = resolvePlayerResponse(data);
+ final parsedResponse = Json.parse(ytInitialPlayerResponse);
+ final streamingData:YouTubeVideoInfo = parsedResponse.streamingData ?? cast {};
+ streamingData.formats ??= [];
+ streamingData.adaptiveFormats ??= [];
+ var formats:Array<YoutubeVideoFormat> = streamingData.formats.concat(streamingData.adaptiveFormats);
+
+ final promises:Array<Promise<Any>> = [];
+
+ final isEncryptedVideo = formats.exists(it -> it.signatureCipher != null);
+ if (isEncryptedVideo) {
+ final promise = new Promise((resolve, reject) -> {
+ buildDecoder(data, decoder -> {
+ if (decoder != null) {
+ formats = formats.map(item -> {
+ if (item.url != null || item.signatureCipher == null) return item;
+
+ item.url = decoder(item.signatureCipher);
+ item.signatureCipher = null;
+ return item;
+ });
+ }
+ resolve(null);
+ });
+ });
+ promises.push(promise);
+ }
+
+ Promise.all(promises).then(_ -> {
+ final result:YouTubeVideoInfo = {
+ videoDetails: parsedResponse.videoDetails ?? cast {},
+ formats: formats.filter(format -> format.url != null)
+ };
+ if (result.videoDetails.isLiveContent) {
+ final m3u8Link = resoleM3U8Link(data);
+ try {
+ result.liveData = {
+ manifestUrl: m3u8Link,
+ // data: m3u8Parser.getResult()
+ };
+ }
+ }
+ callback(result);
+ });
+ });
+ }
+}
diff --git a/src/utils/YoutubeUtils.hx b/src/utils/YoutubeUtils.hx
new file mode 100644
index 0000000..7429565
--- /dev/null
+++ b/src/utils/YoutubeUtils.hx
@@ -0,0 +1,83 @@
+package utils;
+
+typedef YoutubeVideoDetails = {
+ viewCount:String,
+ videoId:String,
+ title:String,
+ thumbnail:{
+ thumbnails:Array<{
+ url:String,
+ width:Int,
+ height:Int,
+ }>
+ },
+ shortDescription:String,
+ lengthSeconds:String,
+ keywords:Array<String>,
+ isUnpluggedCorpus:Bool,
+ isPrivate:Bool,
+ isOwnerViewing:Bool,
+ isLiveContent:Bool,
+ isCrawlable:Bool,
+ channelId:String,
+ author:String,
+ allowRatings:Bool
+}
+
+typedef YoutubeVideoFormat = {
+ ?signatureCipher:String,
+ itag:Int,
+ width:Int,
+ height:Int,
+ url:String,
+ qualityLabel:String, // 240p, 1080p, etc
+ quality:String,
+ projectionType:String,
+ mimeType:String,
+ lastModified:String,
+ bitrate:Int,
+ approxDurationMs:String,
+ ?initRange:{start:Int, end:Int},
+ ?indexRange:{start:Int, end:Int},
+ ?audioQuality:String, // AUDIO_QUALITY_LOW
+ ?audioSampleRate:Int,
+ ?audioChannels:Int
+}
+
+typedef YouTubeVideoInfo = {
+ public var videoDetails:YoutubeVideoDetails;
+ public var ?formats:Array<YoutubeVideoFormat>;
+ public var ?adaptiveFormats:Array<YoutubeVideoFormat>;
+ public var ?liveData:{
+ manifestUrl:String,
+ };
+}
+
+class YoutubeUtils {
+ static final matchId = ~/youtube\.com.*v=([A-z0-9_-]+)/;
+ static final matchShort = ~/youtu\.be\/([A-z0-9_-]+)/;
+ static final matchShorts = ~/youtube\.com\/shorts\/([A-z0-9_-]+)/;
+ static final matchEmbed = ~/youtube\.com\/embed\/([A-z0-9_-]+)/;
+ static final matchPlaylist = ~/youtube\.com.*list=([A-z0-9_-]+)/;
+
+ public static function extractVideoId(url:String):String {
+ if (matchId.match(url)) {
+ return matchId.matched(1);
+ }
+ if (matchShort.match(url)) {
+ return matchShort.matched(1);
+ }
+ if (matchShorts.match(url)) {
+ return matchShorts.matched(1);
+ }
+ if (matchEmbed.match(url)) {
+ return matchEmbed.matched(1);
+ }
+ return "";
+ }
+
+ public static function extractPlaylistId(url:String):String {
+ if (!matchPlaylist.match(url)) return "";
+ return matchPlaylist.matched(1);
+ }
+}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage