Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Ubisoft as a provider. #17

Open
moonstar-x opened this issue Oct 7, 2021 · 1 comment
Open

Add Ubisoft as a provider. #17

moonstar-x opened this issue Oct 7, 2021 · 1 comment
Labels
Priority: Medium This is medium priority. Type: Feature Request This is a feature request.

Comments

@moonstar-x
Copy link
Owner

moonstar-x commented Oct 7, 2021

⚡ Describe the New Feature

Add Ubisoft as a free games provider.

This link contains free offers from Ubisoft: https://free.ubisoft.com/

@moonstar-x moonstar-x added Priority: Medium This is medium priority. Type: Feature Request This is a feature request. labels Oct 7, 2021
@Dom-in Dom-in mentioned this issue Oct 10, 2021
@moonstar-x
Copy link
Owner Author

UPDATE:

I've noticed that the URL aforementioned is actually client-side rendered. One way to extract the data would be using puppeteer but as I've mentioned in #18 I really don't want that.

I've found that the data that populates this site actually comes from a public API. The url seems to have some sort of UUID as a query parameter which doesn't seem to change but I feel like it could since I haven't had enough time to check.

On the other side, I've noticed that the scripts that this page uses are actually not obfuscated and it's quite easy to see what's happening. In this case, https://free.ubisoft.com/configuration.js seems to contain all the necessary data hard-coded, including appId which is necessary for a request header and feedUrl.prod which gives out the actual URL of the API with the respective spaceId included.

Once that data has been extracted, the request should be done to feedUrl.prod with the following headers:

ubi-appid: $appId
ubi-localecode: en-US

Today, there is Rayman Origins for free, and the payload obtained by doing a the following curl:

curl -H "ubi-appid: 314d4fef-e568-454a-ae06-43e3bece12a6" -H "ubi-localecode: en-US" https://public-ubiservices.ubi.com/v1/spaces/news?spaceId=6d0af36b-8226-44b6-a03b-4660073a6349

Is the following:

{
   "news":[
      {
         "spaceId":"6d0af36b-8226-44b6-a03b-4660073a6349",
         "newsId":"ignt.20458",
         "type":"freeweekend",
         "placement":"freeevents",
         "priority":0,
         "displayTime":0,
         "publicationDate":"2021-12-14T16:01:00",
         "expirationDate":"2021-12-20T19:01:00",
         "locale":"en-US",
         "title":"Assassin's Creed Odyssey Free Weekend",
         "body":"Assassin's Creed Odyssey Free Weekend",
         "mediaURL":"https://ubistatic2-a.akamaihd.net/sitegen/assets/img/ac-odyssey/logo_2.png",
         "mediaType":"None",
         "profileId":null,
         "obj":{
            
         },
         "summary":"",
         "links":[
            {
               "type":"External",
               "param":"https://freeweekend.ubisoft.com/assassins-creed-odyssey",
               "actionName":"goto"
            }
         ],
         "tags":[
            
         ]
      },
      {
         "spaceId":"6d0af36b-8226-44b6-a03b-4660073a6349",
         "newsId":"ignt.29448",
         "type":"freegame",
         "placement":"freeevents",
         "priority":0,
         "displayTime":0,
         "publicationDate":"2021-12-14T13:01:00",
         "expirationDate":"2021-12-22T09:01:00",
         "locale":"en-US",
         "title":"Rayman Origins Giveaway",
         "body":"Rayman Origins Giveaway",
         "mediaURL":"https://ubiservices.cdn.ubi.com/6d0af36b-8226-44b6-a03b-4660073a6349/news/RaymanOrigins_logo.png",
         "mediaType":"None",
         "profileId":null,
         "obj":{
            
         },
         "summary":"",
         "links":[
            {
               "type":"External",
               "param":"https://register.ubisoft.com/rayman-origins",
               "actionName":"goto"
            }
         ],
         "tags":[
            
         ]
      },
      {
         "spaceId":"6d0af36b-8226-44b6-a03b-4660073a6349",
         "newsId":"ignt.17206",
         "type":"gametrial",
         "placement":"freeevents",
         "priority":10,
         "displayTime":0,
         "publicationDate":"2021-11-24T07:10:00",
         "expirationDate":null,
         "locale":"en-US",
         "title":"The Crew 2 Trial",
         "body":"The Crew 2 Trial",
         "mediaURL":"https://ubiservices.cdn.ubi.com/6d0af36b-8226-44b6-a03b-4660073a6349/news/TC2_logo_TRIAL_black-light_petit.png",
         "mediaType":"None",
         "profileId":null,
         "obj":{
            
         },
         "summary":"",
         "links":[
            {
               "type":"External",
               "param":"https://register.ubisoft.com/tc2-trial",
               "actionName":"goto"
            }
         ],
         "tags":[
            
         ]
      },
      {
         "spaceId":"6d0af36b-8226-44b6-a03b-4660073a6349",
         "newsId":"ignt.20856",
         "type":"gametrial",
         "placement":"freeevents",
         "priority":6,
         "displayTime":0,
         "publicationDate":"2021-11-09T08:44:00",
         "expirationDate":null,
         "locale":"en-US",
         "title":"Ghost Recon Breakpoint Trial",
         "body":"Ghost Recon Breakpoint Trial",
         "mediaURL":"https://ubiservices.cdn.ubi.com/6d0af36b-8226-44b6-a03b-4660073a6349/news/GRB_TRIAL_LOGO_petit.png",
         "mediaType":"None",
         "profileId":null,
         "obj":{
            
         },
         "summary":"",
         "links":[
            {
               "type":"External",
               "param":"https://register.ubisoft.com/ghost-recon-breakpoint-trial",
               "actionName":"goto"
            }
         ],
         "tags":[
            
         ]
      },
      {
         "spaceId":"6d0af36b-8226-44b6-a03b-4660073a6349",
         "newsId":"ignt.25006",
         "type":"gametrial",
         "placement":"freeevents",
         "priority":1,
         "displayTime":0,
         "publicationDate":"2021-01-28T17:00:00",
         "expirationDate":null,
         "locale":"en-US",
         "title":"Immortals Fenyx Rising Demo",
         "body":"Immortals Fenyx Rising Demo",
         "mediaURL":"https://ubiservices.cdn.ubi.com/6d0af36b-8226-44b6-a03b-4660073a6349/news/Logo_IFR_DEMO-petit.png",
         "mediaType":"None",
         "profileId":null,
         "obj":{
            
         },
         "summary":"",
         "links":[
            {
               "type":"External",
               "param":"https://register.ubisoft.com/immortals-fenyx-rising-demo",
               "actionName":"goto"
            }
         ],
         "tags":[
            
         ]
      },
      {
         "spaceId":"6d0af36b-8226-44b6-a03b-4660073a6349",
         "newsId":"ignt.22687",
         "type":"freegame",
         "placement":"freeevents",
         "priority":1,
         "displayTime":0,
         "publicationDate":"2020-08-11T00:01:00",
         "expirationDate":null,
         "locale":"en-US",
         "title":"Hyper Scape",
         "body":"Hyper Scape",
         "mediaURL":"https://ubiservices.cdn.ubi.com/6d0af36b-8226-44b6-a03b-4660073a6349/news/HYP_logo_S3_red.png",
         "mediaType":"None",
         "profileId":null,
         "obj":{
            
         },
         "summary":"",
         "links":[
            {
               "type":"External",
               "param":"https://register.ubisoft.com/hyper-scape/",
               "actionName":"goto"
            }
         ],
         "tags":[
            
         ]
      },
      {
         "spaceId":"6d0af36b-8226-44b6-a03b-4660073a6349",
         "newsId":"ignt.22045",
         "type":"freegame",
         "placement":"freeevents",
         "priority":2,
         "displayTime":0,
         "publicationDate":"2020-07-01T12:31:00",
         "expirationDate":null,
         "locale":"en-US",
         "title":"Trackmania",
         "body":"Trackmania",
         "mediaURL":"https://ubiservices.cdn.ubi.com/6d0af36b-8226-44b6-a03b-4660073a6349/news/Trackmania_logo_petit.png",
         "mediaType":"None",
         "profileId":null,
         "obj":{
            
         },
         "summary":"",
         "links":[
            {
               "type":"External",
               "param":"https://register.ubisoft.com/trackmania",
               "actionName":"goto"
            }
         ],
         "tags":[
            
         ]
      },
      {
         "spaceId":"6d0af36b-8226-44b6-a03b-4660073a6349",
         "newsId":"ignt.21296",
         "type":"gametrial",
         "placement":"freeevents",
         "priority":6,
         "displayTime":0,
         "publicationDate":"2020-05-04T12:28:00",
         "expirationDate":null,
         "locale":"en-US",
         "title":"Uno Demo",
         "body":"Uno Demo",
         "mediaURL":"https://ubiservices.cdn.ubi.com/6d0af36b-8226-44b6-a03b-4660073a6349/news/Uno_logo_petit.png",
         "mediaType":"None",
         "profileId":null,
         "obj":{
            
         },
         "summary":"",
         "links":[
            {
               "type":"External",
               "param":"https://register.ubisoft.com/uno-trial",
               "actionName":"goto"
            }
         ],
         "tags":[
            
         ]
      },
      {
         "spaceId":"6d0af36b-8226-44b6-a03b-4660073a6349",
         "newsId":"ignt.21102",
         "type":"gametrial",
         "placement":"freeevents",
         "priority":6,
         "displayTime":0,
         "publicationDate":"2020-04-21T10:01:00",
         "expirationDate":null,
         "locale":"en-US",
         "title":"The Division 2 Trial",
         "body":"The Division 2 Trial",
         "mediaURL":"https://ubiservices.cdn.ubi.com/6d0af36b-8226-44b6-a03b-4660073a6349/news/LOGO_1000x375_02_petit.png",
         "mediaType":"None",
         "profileId":null,
         "obj":{
            
         },
         "summary":"",
         "links":[
            {
               "type":"External",
               "param":"https://register.ubisoft.com/the-division-2-trial",
               "actionName":"goto"
            }
         ],
         "tags":[
            
         ]
      },
      {
         "spaceId":"6d0af36b-8226-44b6-a03b-4660073a6349",
         "newsId":"ignt.19781",
         "type":"freegame",
         "placement":"freeevents",
         "priority":4,
         "displayTime":0,
         "publicationDate":"2020-01-30T05:38:00",
         "expirationDate":null,
         "locale":"en-US",
         "title":"Might and Magic Chess Royale",
         "body":"Might and Magic Chess Royale",
         "mediaURL":"https://ubiservices.cdn.ubi.com/6d0af36b-8226-44b6-a03b-4660073a6349/news/MM_LogoV2_petit.png",
         "mediaType":"None",
         "profileId":null,
         "obj":{
            
         },
         "summary":"",
         "links":[
            {
               "type":"External",
               "param":"https://register.ubisoft.com/might_and_magic_chess_royale",
               "actionName":"goto"
            }
         ],
         "tags":[
            
         ]
      },
      {
         "spaceId":"6d0af36b-8226-44b6-a03b-4660073a6349",
         "newsId":"ignt.18333",
         "type":"freegame",
         "placement":"freeevents",
         "priority":5,
         "displayTime":0,
         "publicationDate":"2019-10-08T09:21:00",
         "expirationDate":null,
         "locale":"en-US",
         "title":"Rabbids Coding",
         "body":"Rabbids Coding",
         "mediaURL":"https://ubiservices.cdn.ubi.com/6d0af36b-8226-44b6-a03b-4660073a6349/news/logo2_petit.png",
         "mediaType":"None",
         "profileId":null,
         "obj":{
            
         },
         "summary":"",
         "links":[
            {
               "type":"External",
               "param":"https://register.ubisoft.com/rabbids-coding",
               "actionName":"goto"
            }
         ],
         "tags":[
            
         ]
      },
      {
         "spaceId":"6d0af36b-8226-44b6-a03b-4660073a6349",
         "newsId":"ignt.17738",
         "type":"gametrial",
         "placement":"freeevents",
         "priority":10,
         "displayTime":0,
         "publicationDate":"2019-09-10T09:15:00",
         "expirationDate":null,
         "locale":"en-US",
         "title":"Trials Rising Demo",
         "body":"Trials Rising Demo",
         "mediaURL":"https://ubiservices.cdn.ubi.com/6d0af36b-8226-44b6-a03b-4660073a6349/news/logo_petit82.png",
         "mediaType":"None",
         "profileId":null,
         "obj":{
            
         },
         "summary":"",
         "links":[
            {
               "type":"External",
               "param":"https://register.ubisoft.com/trials-rising-demo",
               "actionName":"goto"
            }
         ],
         "tags":[
            
         ]
      },
      {
         "spaceId":"6d0af36b-8226-44b6-a03b-4660073a6349",
         "newsId":"ignt.16832-2",
         "type":"gametrial",
         "placement":"freeevents",
         "priority":10,
         "displayTime":0,
         "publicationDate":"2019-06-27T00:01:00",
         "expirationDate":null,
         "locale":"en-US",
         "title":"Ghost Recon Wildlands Trial",
         "body":"Ghost Recon Wildlands Trial",
         "mediaURL":"https://ubiservices.cdn.ubi.com/6d0af36b-8226-44b6-a03b-4660073a6349/news/GRW_Trial_logo_Black_petit.png",
         "mediaType":"None",
         "profileId":null,
         "obj":{
            
         },
         "summary":"",
         "links":[
            {
               "type":"External",
               "param":"https://register.ubisoft.com/ghost-recon-wildlands-trial",
               "actionName":"goto"
            }
         ],
         "tags":[
            
         ]
      },
      {
         "spaceId":"6d0af36b-8226-44b6-a03b-4660073a6349",
         "newsId":"ignt.16832-1",
         "type":"gametrial",
         "placement":"freeevents",
         "priority":10,
         "displayTime":0,
         "publicationDate":"2019-06-27T00:01:00",
         "expirationDate":null,
         "locale":"en-US",
         "title":"The Division Trial",
         "body":"The Division Trial",
         "mediaURL":"https://ubiservices.cdn.ubi.com/6d0af36b-8226-44b6-a03b-4660073a6349/news/peti.png",
         "mediaType":"None",
         "profileId":null,
         "obj":{
            
         },
         "summary":"",
         "links":[
            {
               "type":"External",
               "param":"https://register.ubisoft.com/the-division-trial",
               "actionName":"goto"
            }
         ],
         "tags":[
            
         ]
      }
   ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Medium This is medium priority. Type: Feature Request This is a feature request.
Projects
None yet
Development

No branches or pull requests

1 participant