11clientId <- "4851603";
2- redirectUri <- "https://oauth.vk.com /blank.html";
3- redirectUrlEscaped <- "https:\\/\\/oauth\\.vk\\.com \\/blank\\.html";
2+ redirectUri <- "https://oauth.vk.ru /blank.html";
3+ redirectUrlEscaped <- "https:\\/\\/oauth\\.vk\\.ru \\/blank\\.html";
44apiVersion <- "5.131";
55expiresIn <- 0;
66testMode <- "1"; // not used
@@ -68,7 +68,7 @@ function OnNavigateError(data) {
6868
6969function checkResponse (json) {
7070 try {
71- WriteLog (" error" , " vk.com error: " + json. error . error_msg );
71+ WriteLog (" error" , " vk.ru error: " + json. error . error_msg );
7272 return 0 ;
7373 } catch ( ex ) {
7474
@@ -99,12 +99,12 @@ function Authenticate() {
9999 ServerParams. setParam (" expiresIn" , " " );
100100 ServerParams. setParam (" tokenTime" , " " );
101101 local browser = CWebBrowser ();
102- browser. setTitle (tr (" vk.browser.title" , " Vk.com authorization" ))
102+ browser. setTitle (tr (" vk.browser.title" , " vk.ru authorization" ))
103103 browser. setOnUrlChangedCallback (OnUrlChangedCallback, null );
104104 // browser.setOnNavigateErrorCallback(OnNavigateError, null);
105105 // browser.setOnLoadFinishedCallback(OnLoadFinished, null);
106106
107- local url = " https://oauth.vk.com /authorize?" +
107+ local url = " https://oauth.vk.ru /authorize?" +
108108 " client_id=" + clientId +
109109 " &scope=photos" +
110110 " &redirect_uri=" + nm. urlEncode (redirectUri) +
@@ -149,7 +149,7 @@ function DoLogout() {
149149function GetFolderList (list) {
150150 local userId = ServerParams. getParam (" userId" );
151151 local token = ServerParams. getParam (" token" );
152- nm. doGet (" https://api.vk.com /method/photos.getAlbums?owner_id=" + userId + " &v=" + apiVersion + " &access_token=" + token);
152+ nm. doGet (" https://api.vk.ru /method/photos.getAlbums?owner_id=" + userId + " &v=" + apiVersion + " &access_token=" + token);
153153 if (nm. responseCode () != 200 ) {
154154 return 0 ;
155155 }
@@ -165,7 +165,7 @@ function GetFolderList(list) {
165165 album. setTitle (item. title );
166166 album. setSummary (item. description );
167167 album. setAccessType (StringPrivacyToAccessType (item. privacy_view . category ));
168- album. setViewUrl (" https://vk.com /album" + userId + " _" + item. id );
168+ album. setViewUrl (" https://vk.ru /album" + userId + " _" + item. id );
169169 list. AddFolderItem (album);
170170 }
171171 return 1 ;
@@ -174,7 +174,7 @@ function GetFolderList(list) {
174174function GetFirstAlbumId () {
175175 local userId = ServerParams. getParam (" userId" );
176176 local token = ServerParams. getParam (" token" );
177- nm. doGet (" https://api.vk.com /method/photos.getAlbums?owner_id=" + userId + " &v=" + apiVersion + " &access_token=" + token);
177+ nm. doGet (" https://api.vk.ru /method/photos.getAlbums?owner_id=" + userId + " &v=" + apiVersion + " &access_token=" + token);
178178 if ( nm. responseCode () != 200 ) {
179179 return 0 ;
180180 }
@@ -204,7 +204,7 @@ function CreateFolder(parentAlbum, album) {
204204 nm. addQueryParam (" privacy_view" , AccessTypeToPrivacy (accessType));
205205 nm. addQueryParam (" privacy_comment" , AccessTypeToPrivacy (accessType));
206206
207- nm. setUrl (" https://api.vk.com /method/photos.createAlbum?user_id=" + userId + " &v=" + apiVersion + " &access_token=" + token);
207+ nm. setUrl (" https://api.vk.ru /method/photos.createAlbum?user_id=" + userId + " &v=" + apiVersion + " &access_token=" + token);
208208
209209 nm. doPost (" " );
210210 if ( nm. responseCode () != 200 && nm. responseCode () != 201 ) {
@@ -220,7 +220,7 @@ function CreateFolder(parentAlbum, album) {
220220 album. setSummary (t. response . description );
221221 album. setAccessType (StringPrivacyToAccessType (t. response . privacy_view . category ));
222222 album. setTitle (t. response . title );
223- album. setViewUrl (" https://vk.com /album" + userId + " _" + t. response . id );
223+ album. setViewUrl (" https://vk.ru /album" + userId + " _" + t. response . id );
224224
225225 return 1 ;
226226}
@@ -240,7 +240,7 @@ function ModifyFolder(album) {
240240 nm. addQueryParam (" owner_id" , userId);
241241 nm. addQueryParam (" privacy_view" , AccessTypeToPrivacy (accessType));
242242 nm. addQueryParam (" privacy_comment" , AccessTypeToPrivacy (accessType));
243- nm. setUrl (" https://api.vk.com /method/photos.editAlbum?user_id=" + userId + " &v=" + apiVersion + " &access_token=" + token);
243+ nm. setUrl (" https://api.vk.ru /method/photos.editAlbum?user_id=" + userId + " &v=" + apiVersion + " &access_token=" + token);
244244
245245 nm. doPost (" " );
246246 if ( nm. responseCode () == 200 ) {
@@ -273,7 +273,7 @@ function UploadFile(FileName, options) {
273273 }
274274 local thumbWidth = options. getParam (" THUMBWIDTH" );
275275 thumbWidth = thumbWidth. tointeger ();
276- nm. doGet (" https://api.vk.com /method/photos.getUploadServer?user_id=" + userId + " &v=" + apiVersion + " &access_token=" + token+ " &album_id=" + albumId);
276+ nm. doGet (" https://api.vk.ru /method/photos.getUploadServer?user_id=" + userId + " &v=" + apiVersion + " &access_token=" + token+ " &album_id=" + albumId);
277277 if ( nm. responseCode () != 200 ) {
278278 return 0 ;
279279 }
@@ -298,7 +298,7 @@ function UploadFile(FileName, options) {
298298 nm. addQueryParam (" photo_sizes" , " 1" );
299299 nm. addQueryParam (" https" , " 1" );
300300
301- nm. setUrl (" https://api.vk.com /method/photos.save?user_id=" + userId + " &v=" + apiVersion + " &access_token=" + token);
301+ nm. setUrl (" https://api.vk.ru /method/photos.save?user_id=" + userId + " &v=" + apiVersion + " &access_token=" + token);
302302
303303 nm. doPost (" " );
304304 if ( nm. responseCode () >= 200 && nm. responseCode () <= 299 ) {
@@ -327,7 +327,7 @@ function UploadFile(FileName, options) {
327327
328328 options. setDirectUrl (directUrl);
329329 options. setThumbUrl (thumbUrl);
330- options. setViewUrl (" https://vk.com /photo" + userId + " _" + item. id );
330+ options. setViewUrl (" https://vk.ru /photo" + userId + " _" + item. id );
331331
332332 return 1 ;
333333 }
0 commit comments