add support for etomesto.ru
Closed this issue · 16 comments
Good morning, @lovasoa. I hope everything goes well!
I would have a problem dezoomifying this map: as You can see, it's already georeferenced and this makes everything more convenient for my maps' construction hobby. I tried both the Dezoomify Extension and the Generic Dezoomifier, but I was unsuccessful.
This issue in dezoomify references the same site: lovasoa/dezoomify#449
Quickly looking at the tile URL structure, it looks like you should be able to create a tiles.yaml for it. See https://github.com/lovasoa/dezoomify-rs/wiki/Usage-example-for-the-custom-YAML-dezoomer
I'm doing something wrong ... I'm really mortified, but I don't khow how to solve this on my own.
After a few failed attempts, I made a tiles.yaml
that dezoomify-rs accepts but the result is a blank image and Error 404.
url_template: "http://mapt.etomesto.ru/orenburg/orenburgskoe-voysko-1871-1875/{{x}}/{{y}}.jpg"
variables:
- name: x
from: 0
to: 18000 # Image width
step: 200 # Tile width
- name: y
from: 0
to: 11800 # Image height
step: 200 # Tile height
headers:
Referer: "http://www.etomesto.ru/view.php?map=orenburg_orenburgskoe-voysko-1871-1875&key=1&x=55.101479&y=51.762711"
title: "Карта Оренбургского казачьего войска 1871 - 1875 годов"
It's not you, it always takes a few attempts to find the right values to put in. You should open your browser's network console and observe the values of x and y in the requests it makes. You have to find the min and max values for x and y. For step, it looks like it's just 1. Neighbouring tiles seem to have consecutive values of x and y.
You should open your browser's network console while zooming and panning on the image to find the first and last values of x and y to put in your tiles.yaml.
Done. Same result.
I would also add that Issue #120 itself is also deprecated. I'll change the title.
did you fix your url template ?
0/5640 ?! Aren't you requesting too many tiles ? Are you sure you found the correct start and end values for x and y ?
Did you check that x goes from 1 to 90 and y goes from 1 to 49 ? You can see that in your browser's network inspector.
Where do these 1 and 90 values come from ? You should check what the actual values for min and max tile number are in your browser.
Good and bad news:
I solved the problem with #120 maps (minor changes in https construction) but not with EtoMesto.ru. Since the size of each tile is 200px, by mathematical calculation I can deduce that x goes from 1 to 90 (18000px), y goes from 1 to 59 (11800px), for a total of 5310 tiles. I also make sorther the file tiles.yaml
.
url_template: "http://mapt.etomesto.ru/orenburg/orenburgskoe-voysko-1871-1875/9/{{x}}_{{y}}.jpg"
x_template: "x * tile_size"
y_template: "y * tile_size"
variables:
- { name: x, from: 1, to: 90 } # Number of tiles on the x axis
- { name: y, from: 1, to: 59 } # Number of tiles on the y axis
- { name: tile_size, value: 200 }
headers:
Referer: "http://www.etomesto.ru/view.php?map=orenburg_orenburgskoe-voysko-1871-1875&key=1&x=55.101479&y=51.762711"
However, even so, network error: HTTP status client error (404 Not Found) persists🤯.
I also tried adding the -H argument, referring to the page's Cookies
, but that doesn't work (the website may interpret that the download isn't from the legitimate viewer). The format of the tiles itself is anomalous, 'cause it contains three numerical parameters instead of two (x and y).
Finally, a solution was never given to the Issue lovasoa/dezoomify#449
I finally found the time to look at it closer.
The problem is the part of the url before the x coordinate. Here is how they generate it:
ft[1] = "c";
ft[2] = "c";
ft[3] = "e";
ft[4] = "a";
ft[5] = "e";
ft[6] = "1";
ft[7] = "8";
ft[8] = "c";
ft[9] = "4";
ft[10] = "d";
ft[11] = "6";
ft[12] = "c";
ft[13] = "c";
ft[14] = "a";
ft[15] = "9";
ft[16] = "c";
ft[17] = "7";
ft[18] = "6";
ft[19] = "1";
ft[20] = "9";
ft[21] = "3";
ft[22] = "b";
ft[23] = "3";
ft[24] = "1";
ft[25] = "8";
ft[26] = "4";
ft[27] = "0";
ft[28] = "3";
ft[29] = "6";
ft[30] = "3";
ft[31] = "c";
ft[32] = "6";
ft[33] = "1";
ft[34] = "e";
ft[35] = "1";
ft[36] = "1";
ft[37] = "a";
ft[38] = "a";
ft[39] = "d";
ft[40] = "d";
ft[41] = "3";
ft[42] = "a";
ft[43] = "1";
ft[44] = "f";
ft[45] = "6";
ft[46] = "d";
ft[47] = "6";
ft[48] = "6";
ft[49] = "f";
ft[50] = "c";
ft[51] = "2";
ft[52] = "9";
ft[53] = "d";
ft[54] = "a";
ft[55] = "b";
ft[56] = "9";
ft[57] = "7";
ft[58] = "6";
ft[59] = "0";
ft[60] = "0";
ft[61] = "7";
ft[62] = "4";
ft[63] = "0";
ft[64] = "e";
ft[65] = "f";
ft[66] = "3";
ft[67] = "7";
ft[68] = "a";
ft[69] = "1";
ft[70] = "7";
ft[71] = "e";
ft[72] = "3";
ft[73] = "d";
ft[74] = "a";
ft[75] = "d";
ft[76] = "f";
ft[77] = "2";
ft[78] = "3";
ft[79] = "d";
ft[80] = "f";
ft[81] = "4";
ft[82] = "9";
ft[83] = "f";
ft[84] = "6";
ft[85] = "3";
ft[86] = "9";
ft[87] = "c";
ft[88] = "2";
ft[89] = "7";
ft[90] = "8";
[...]
var text = text +
"<img src=" + host +
"/orenburg/orenburgskoe-voysko-1871-1875/" + ft[ix] + "/" + ix + "_" + iy + ".jpg width=" +
tile + " height=" + tile + " border=0 class=tl>";
This is not a known dezoomify-rs format, and wouldn't work with the generic dezoomer either.
I implemented str::substring
in dezoomify-rs v2.12 to make it possible to handle such cases in tiles.yaml
url_template:
'http://mapt.etomesto.ru/orenburg/orenburgskoe-voysko-1871-1875/{{
str::substring(" cceae18c4d6cca9c76193b31840363c61e11aadd3a1f6d66fc29dab97600740ef37a17e3dadf23df49f639c278", x, x+1)
}}/{{x}}_{{y}}.jpg'
x_template: "x * tile_size"
y_template: "y * tile_size"
variables:
- { name: "x", from: 1, to: 78 }
- { name: "y", from: 1, to: 55 }
- { name: "tile_size", value: 200 }
Thank you so much and from the bottom of my heart for your time and kindness, @lovasoa!
It's just a problem that's way far far beyond my understanding😱. I would never have done it. When the new version will being stable, please add o the tutorial for creating tiles.yaml
how to find & write the str::substring
(to not bother you again).
Thanks again and sorry for the inconvenience ... and happy Christmas holidays🎄(a little early).
I released the new version of dezoomify-rs where str::substring
is available: https://github.com/lovasoa/dezoomify-rs/releases
The long seemingly random string to use can be found by inspecting the page on etomesto.ru:
In the network panel, I found a tile and clicked the "initiator" tab:
then opened the link:
and scrolled up a bit
Happy christmas to you ;)