public BigoSiteContext(ICommentOptions options, IBigoServer server, ILogger logger, IUserStoreManager userStoreManager)
     : base(options, userStoreManager, logger)
 {
     _options = options;
     _server  = server;
     _logger  = logger;
 }
示例#2
0
        public CommentProvider(ICommentOptions options, IBigoServer server, BigoSiteOptions siteOptions, ILogger logger, IUserStoreManager userStoreManager)
        {
            _options          = options;
            _siteOptions      = siteOptions;
            _logger           = logger;
            _userStoreManager = userStoreManager;
            _server           = server;

            CanConnect    = true;
            CanDisconnect = false;
        }
示例#3
0
        public static async Task <Gift[]> GetOnlineGift(DateTime now, IBigoServer server, CookieContainer cc)
        {
            var time   = Tools.GetCurrentUnixTimeMillseconds(now);
            var random = "7317262808793148";
            var url    = $"https://activity.bigo.tv/live/giftconfig/getOnlineGifts?jsoncallback=id_{time}_{random}";
            var res    = await server.GetAsync(url);

            var match = System.Text.RegularExpressions.Regex.Match(res, "^id_\\d+_\\d+\\((.+)\\)$");

            if (!match.Success)
            {
                throw new SpecChangedException(res);
            }
            var json  = match.Groups[1].Value;
            var gifts = JsonConvert.DeserializeObject <Gift[]>(json);

            return(gifts);
        }
示例#4
0
        public static async Task <WebSocketLink> GetWebSocketLink(IBigoServer server, CookieContainer cc)
        {
            var url = "https://www.bigo.tv/studio/getWebSocketLink";
            var res = await server.GetAsync(url);

            dynamic d = JsonConvert.DeserializeObject(res);

            if (!d.ContainsKey("code") || d.code != 0)
            {
                throw new NotImplementedException();
            }
            var uidToken = ((string)d.data.uidToken).Replace("###VER2", "");
            var deviceId = (string)d.data.deviceId;
            var userId   = (string)d.data.userId;
            var ret      = new WebSocketLink
            {
                DeviceId = deviceId,
                UidToken = uidToken,
                UserId   = userId,
            };

            return(ret);
        }
示例#5
0
        public static async Task <InternalStudioInfo> GetInternalStudioInfo(string bigoId, IBigoServer server, CookieContainer cc)
        {
            var url  = "https://www.bigo.tv/studio/getInternalStudioInfo";
            var data = new Dictionary <string, string>
            {
                { "siteId", bigoId }
            };
            var res = await server.PostAsync(url, data, cc);

            dynamic d = JsonConvert.DeserializeObject(res);

            if (!d.ContainsKey("code") || d.code != 0)
            {
                throw new NotImplementedException();
            }
            var roomid = (string)d.data.roomId;
            var info   = new InternalStudioInfo
            {
                RoomId = roomid,
            };

            return(info);
        }