Files
likemath.ru/posts/eksport-partii-s-lichess/index.html

17 lines
6.4 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--><!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--><!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--><!--[if gt IE 8]><!--><html class="no-js"> <head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><title>Экспорт партий с Lichess</title><meta name="description" content><meta name="viewport" content="width=device-width"><link rel="stylesheet" href="../../theme/css/normalize.css"><link href="http://fonts.googleapis.com/css?family=Philosopher&subset=latin,cyrillic" rel="stylesheet" type="text/css"><link href="http://fonts.googleapis.com/css?family=Forum&subset=cyrillic" rel="stylesheet" type="text/css"><link href="//fonts.googleapis.com/css?family=Oswald" rel="stylesheet" type="text/css"><link href="http://fonts.googleapis.com/css?family=Ubuntu+Mono" rel="stylesheet" type="text/css"><link href="http://fonts.googleapis.com/css?family=PT+Sans" rel="stylesheet" type="text/css"><link rel="stylesheet" href="../../theme/css/font-awesome.min.css"><link rel="stylesheet" href="../../theme/css/main.css"><link rel="stylesheet" href="../../theme/css/blog.css"><link rel="stylesheet" href="../../theme/css/github.css"><link href="http://likemath.ru/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Блог 529 Atom Feed"><link href="http://likemath.ru/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Блог 529 RSS Feed"><script src="../../theme/js/vendor/modernizr-2.6.2.min.js"></script></head><body><!--[if lt IE 7]>
<p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
<![endif]--><div id="wrapper"><header id="sidebar" class="side-shadow"><hgroup id="site-header"><a id="site-title" href="../.."><h2><i class="icon-pencil"></i> Блог 529</h2></a><p id="site-desc"> Project Euler и остальное </p></hgroup><nav><ul id="nav-links"><li><a href="../../">Главная</a></li><li><a href="../../pages/projects.html">Мои проекты</a></li><li><a href="../../pages/about.html">Об авторе</a></li><li><a href="../../feeds/feed.atom.xml">Atom feed</a></li></ul></nav><footer id="site-info"><p> Powered by Pelican. </p></footer></header><div id="post-container"><ol id="post-list"><li><article class="post-entry"><header class="entry-header"><time class="post-time" datetime="2017-07-17T13:35:00+03:00" pubdate> Пн 17 Июль 2017 </time><a href="../../posts/eksport-partii-s-lichess/" rel="bookmark"><h1>Экспорт партий с&nbsp;Lichess</h1></a></header><section class="post-content"><p>Одну партию с Lichess скачать довольно просто, это можно сделать на странице с самой игрой. Скачать все игры тоже несложно, для этого есть специальный <a href="https://database.lichess.org/">раздел</a>.</p><p>Если же хочется скачать свои партии, то я нашёл лишь одно <a href="https://github.com/cyanfish/lichess-scid">решение</a>. Последний коммит был сделан 2 года назад, также оно не учитывает ограничения <a href="https://github.com/ornicar/lila#http-api"><span class="caps">API</span></a>, и больше ~2000 партий, за раз скачать не&nbsp;получится.</p><p>Моей целью было написание альтернативы, которая бы работала быстрее и работала&nbsp;корректно.</p><p>Проблема формата решена довольно просто: <span class="caps">API</span> отдаёт <span class="caps">PGN</span>, значит его поддержка уже есть. Но это плохой формат для хранения и обработки. Поэтому нужно было выбрать что-то&nbsp;ещё.</p><p>Существует, практически, только Scid, если вы хотите хранить свои шахматные партии, используя открытый софт. В его дистрибутиве уже есть необходимые утилиты для конвертации pgn в свой&nbsp;формат.</p><p>Репозиторий <a href="https://github.com/AlekseyLobanov/lichess-export/">здесь</a>, а <a href="https://github.com/AlekseyLobanov/lichess-export/archive/master.zip">здесь</a> можно скачать файлы&nbsp;сразу.</p><h3>Возможности</h3><ol><li>Многопоточность</li><li>Сохранение как в <span class="caps">PGN</span>, так и в формат&nbsp;Scid</li><li>Для работы необходим только&nbsp;Python</li><li>Работает при любом числе&nbsp;партий</li></ol><h3>Установка</h3><div class="highlight"><pre><span class="code-line"><span></span>pip install grequests</span>
</pre></div><h3>Запуск</h3><div class="highlight"><pre><span class="code-line"><span></span>python lichess.py -n hippo23 -t pgn -o hippo23.pgn --threads <span class="m">6</span> </span>
</pre></div><p>Здесь <code>hippo23</code> мой ник, а <code>pgn</code> формат сохранения (доступен также <code>scid</code>). </p></section><hr><aside class="post-meta"><p>Категория: <a href="../../category/proekty.html">Проекты</a></p><p>Теги: <a href="../../tag/proekt.html">проект</a>, <a href="../../tag/shakhmaty.html">шахматы</a>, <a href="../../tag/lichess.html">lichess</a>, </p></aside><hr></article></li></ol></div></div><script type="text/javascript">
var _paq = _paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//piwik.likemath.ru/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', '1']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
</script> <script src="../../theme/js/main.js"></script></body></html>