X-Git-Url: https://git.cweiske.de/ouya-game-data.git/blobdiff_plain/a1ed0042bbf42348c67fa5bfea854815eb86e1e3..98fbf1b6f22a862bce59813007139f12f1078e14:/bin/replace-game-images-by-list diff --git a/bin/replace-game-images-by-list b/bin/replace-game-images-by-list index 223e398..74df284 100755 --- a/bin/replace-game-images-by-list +++ b/bin/replace-game-images-by-list @@ -52,6 +52,19 @@ foreach ($files as $file) { function replaceImage(&$url) { global $mapping; + + preg_match('#https://www.filepicker.io/api/file/([^/]+)/convert\?w=720#', $url, $matches); + if (isset($matches[1])) { + $url = 'https://d3e4aumcqn8cw3.cloudfront.net/api/file/' . $matches[1]; + } + + if (strlen($url) == 55) { + preg_match('#https://www.filepicker.io/api/file/([^/]+)$#', $url, $matches); + if (isset($matches[1])) { + $url = 'https://d3e4aumcqn8cw3.cloudfront.net/api/file/' . $matches[1]; + } + } + if (isset($mapping[$url])) { $url = $mapping[$url]; }