online-judge-tools/oj

サンプルがダウンロードできない問題

udon1206 opened this issue · 2 comments

Summary / 概要

https://onlinejudge.u-aizu.ac.jp/problems/1390 でサンプルのダウンロードに失敗する

Steps to reproduce / 再現方法

oj d https://onlinejudge.u-aizu.ac.jp/problems/1390

environments:

  • online-judge-tools 11.1.4 (+ online-judge-api-client 10.8.0)

Expected behavior / 期待される挙動

サンプルがダウンロードされる

Actual behavior / 実際の挙動

[INFO] online-judge-tools 11.1.4 (+ online-judge-api-client 10.8.0)
[INFO] problem recognized: AOJProblem.from_url('http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1390'): https://onlinejudge.u-aizu.ac.jp/problems/1390
[INFO] load cookie from: /Users/jupiro/Library/Application Support/online-judge-tools/cookie.jar
[NETWORK] GET: https://judgedat.u-aizu.ac.jp/testcases/samples/1390
[NETWORK] 200 OK
[WARNING] sample cases are not registered in the official API
[INFO] fallback: parsing HTML
[NETWORK] GET: https://judgeapi.u-aizu.ac.jp/resources/descriptions/ja/1390
[NETWORK] 200 OK
[ERROR] strange name for output string: Sample Input 3
[ERROR] Failed to download test cases
Traceback (most recent call last):
  File "/Library/Python/3.8/site-packages/onlinejudge_command/subcommand/download.py", line 100, in run
    samples = problem.download_sample_cases(session=sess)
  File "/Users/jupiro/Library/Python/3.8/lib/python/site-packages/onlinejudge/service/aoj.py", line 102, in download_sample_cases
    zipper.add(s.encode(), tag.string)
  File "/Users/jupiro/Library/Python/3.8/lib/python/site-packages/onlinejudge/_implementation/testcase_zipper.py", line 31, in add
    raise SampleParseError()
onlinejudge.type.SampleParseError: failed to parse samples
[INFO] save cookie to: /Users/jupiro/Library/Application Support/online-judge-tools/cookie.jar

Other notes / その他

  • Will you try to create a pull request?
    • no
kmyk commented

調べてみましたが、HTML が </h3>Sample Output 2</h3> と壊れているようです。AOJ 側の問題なので online-judge-tools 側ではどうにもできません。:bow:

<h3>Sample Input 1</h3>
<pre>
6
0 1 3 5 6 9
</pre>

<h3>Sample Output 1</h3>
<pre>
4
</pre>

<h3>Sample Input 2</h3>
<pre>
7
1 4 7 3 2 6 5
</pre>

</h3>Sample Output 2</h3>
<pre>
7
</pre>

<h3>Sample Input 3</h3>
<pre>
5
1 2 4 8 16
</pre>

<h3>Sample Output 3</h3>
<pre>
2
</pre>

これ AOJ に報告した結果治りました

ありがとうございます