Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typeof Roblox == "undefined" && (Roblox = {}), typeof Roblox.SignupOrLogin == "undefined" && (Roblox.SignupOrLogin = function() {
- var r = {
- unknown: 1, //none selected
- male: 2, //M selected
- female: 3 //F selected
- },
- u = { //which action to choose
- signup: 0,
- login: 1
- },
- f = { //???
- signup: 0,
- login: 1,
- captcha: 2,
- twostep: 3
- },
- n, t, e = function(t) { //n and t appear empty but they're assigned later on in the script??
- typeof n == "function" && n(t)
- },
- o = function(n) {
- typeof t == "function" && t(n)
- },
- i = function(n) { //reset all POST params
- n.data("params", {})
- },
- s = function(r) { //init
- typeof r.onSignupSuccess == "function" && (n = r.onSignupSuccess), typeof r.onLoginSuccess == "function" && (t = r.onLoginSuccess), i($(".signup-or-log-in"))
- },
- h = function(n, t, i) { //addSignupParam
- var r = n.data("params");
- typeof r == "undefined" && (r = {}), r[t] = {
- name: t,
- value: i
- }, n.data("params", r)
- };
- return { //later on in the script it says things like Roblox.SignupOrLogin.SectionType....
- GenderType: r,
- SectionType: f,
- CaptchaFlowType: u,
- addSignupParam: h,
- onLoginSuccess: o,
- onSignupSuccess: e,
- resetParams: i,
- init: s
- }
- })
- signupOrLogin.controller("CaptchaController", ["$scope", "$http", "$rootElement", "captchaService", "displayService", function(n, t, i, r, u) {
- var f = function() {
- Recaptcha.reload()
- };
- n.isSubmitting = !1, n.submitCaptcha = function(t) {
- r.submitCaptcha(t, f, n)
- }, n.isSectionShown = !1, n.$on("display:updated", function(t, i) {
- n.$validationMessage = "", n.isSectionShown = i === Roblox.SignupOrLogin.SectionType.captcha
- }), n.captchaFlowType = Roblox.SignupOrLogin.CaptchaFlowType.signup, n.$on("captcha:loaded", function(t, i) {
- n.captchaResponse = "", n.captchaFlowType = i.captchaFlow, n.username = i.username, f(), u.setDisplayState(Roblox.SignupOrLogin.SectionType.captcha), n.isSectionShown = !0, Roblox.SignupOrLoginIframe && Roblox.SignupOrLoginIframe.resizeFrame(Roblox.SignupOrLogin.SectionType.captcha)
- })
- }]);
- signupOrLogin.controller("SignupOrLoginController", ["$document", "$rootScope", "displayService", function(n, t, i) {
- n.on("display:updated", function(n, r) {
- i.setDisplayState(r), t.$apply()
- })
- }]);
- signupOrLogin.factory("captchaService", ["$rootScope", "$http", function(n, t) { //just your standard captcha???
- var i = Roblox.SignupOrLogin.CaptchaFlowType.signup,
- u = function(n, u, f) {
- var o = angular.element(n.target),
- s = angular.element(".signup-or-log-in .captcha-container"),
- h = {
- recaptcha_challenge_field: s.find("#recaptcha_challenge_field").val(),
- recaptcha_response_field: s.find("#recaptcha_response_field").val()
- },
- e;
- if (f.captchaFlowType === Roblox.SignupOrLogin.CaptchaFlowType.signup) e = o.data("signup-captcha-api-url"); //url: https://api.roblox.com/captcha/validate/signup
- //login isn't important right now //else if (i === Roblox.SignupOrLogin.CaptchaFlowType.login) e = o.data("log-in-captcha-api-url"), h.username = f.username;
- else throw "Unknown Captcha flow";
- f.isSubmitting = !0, t({
- method: "POST",
- url: e,
- data: $.param(h),
- headers: {
- "Content-Type": "application/x-www-form-urlencoded"
- },
- crossDomain: !0
- }).success(function() {
- f.isSubmitting = !1, f.$validationMessage = "", r()
- }).error(function(n, t) {
- f.isSubmitting = !1, t === 403 ? (f.$validationMessage = "Captcha incorrect", u()) : (f.$validationMessage = "Unknown error", u())
- })
- },
- r = function() {
- i == Roblox.SignupOrLogin.CaptchaFlowType.signup ? n.$broadcast("captcha:signupSuccess") : i == Roblox.SignupOrLogin.CaptchaFlowType.login && n.$broadcast("captcha:loginSuccess")
- };
- return {
- getCaptchaFlowType: function() {
- return i
- },
- setCaptchaFlowType: function(t, r) {
- i = t;
- var u = {
- captchaFlow: t
- };
- r && (u.username = r), n.$broadcast("captcha:loaded", u)
- },
- onAfterCaptchaSuccess: r,
- submitCaptcha: u
- }
- }]);
- signupOrLogin.factory("signupService", ["$http", "captchaService", "displayService", "$rootElement", function(n, t, i) {
- var u = function(r) {
- var s = angular.element("#signup-button"),
- h = s.data("signup-api-url"), //this URL is https://api.roblox.com/signup/v1
- u = {},
- o = angular.element(".signup-or-log-in"),
- e = o.data("params"),
- f;
- typeof e == "undefined" && (e = {}), $.each(e, function(n, t) {
- u[n] = t
- }), f = o.data("metadata-params"), typeof f == "undefined" && (f = {}), $.each(f, function(n, t) {
- u[n] = t
- }), $.extend(u, {
- username: r.signup.username,
- password: r.signup.password,
- birthday: r.signup.birthdayDay + " " + r.signup.birthdayMonth + " " + r.signup.birthdayYear,
- gender: r.signup.gender,
- context: r.signupForm.context
- }), n({
- method: "POST",
- url: h,
- data: $.param(u),
- headers: {
- "Content-Type": "application/x-www-form-urlencoded"
- },
- crossDomain: !0,
- withCredentials: !0
- }).success(function(n) {
- Roblox.SignupOrLogin.onSignupSuccess(n.userId)
- }).error(function(n, u) {
- if (r.badSubmit = !0, r.isSubmitting = !1, u === 403) {
- var f = 0;
- n.reasons.indexOf("Captcha") !== -1 && (r.isSubmitting = !1, r.isSectionShown = !1, i.setDisplayState(Roblox.SignupOrLogin.SectionType.captcha), t.setCaptchaFlowType(Roblox.SignupOrLogin.CaptchaFlowType.signup), f += 1), n.reasons.indexOf("GenderInvalid") !== -1 && (r.signup.gender = 1, f += 1), n.reasons.indexOf("PasswordInvalid") !== -1 && (r.signupForm.password.$setValidity("password", !1), r.signupForm.password.$passwordMessage = "Password is invalid", f += 1), n.reasons.indexOf("UsernameInvalid") !== -1 && (r.signupForm.username.$setValidity("validusername", !1), r.signupForm.username.$usernameMessage = "Username is invalid", f += 1), n.reasons.indexOf("UsernameTaken") !== -1 && (r.signupForm.username.$setValidity("unique", !1), r.signupForm.username.$usernameMessage = "Username is taken", f += 1), f < n.reasons.length && (r.signupForm.$generalError = !0, r.signupForm.$generalErrorText = "Sorry, an error occurred.")
- } else r.signupForm.$generalError = !0, r.signupForm.$generalErrorText = "Sorry, an error occurred."
- })
- },
- return {
- submitSignup: u
- }
- }]);
- data = {
- 'username':'1md01923mj', #random
- 'password':'1md01923mj00',
- 'birthday':'4 Nov 1981',
- 'gender':3, #I presume it's an int instead of a str, the JavaScript doesn't use strings with this.
- 'context':'RollerCoaster', #required, otherwise we get an InternalServer error
- 'isEligibleForHideAdsAbTest':'False', #same as above
- }
- headers = { #same as the JavaScript
- "Content-Type": "application/x-www-form-urlencoded",
- }
- url='https://api.roblox.com/signup/v1' #same as JavaScript
- r=Session.post(url=url, data=data, headers=headers, verify=True) #POST the request
- print(r.text, r.status_code)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement