hiroki0008 commited on
Commit
aa937e5
·
verified ·
1 Parent(s): 395503f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -78,12 +78,13 @@ def download_one(session: requests.Session, url: str, outdir: str, pref: str) ->
78
  fname = guess_filename_from_headers(r, f"{pref}_{file_id}.xlsx")
79
  path = os.path.join(outdir, fname)
80
  with open(path, "wb") as f:
81
- for chunk in r.iter_iterable = r.iter_content(chunk_size=1 << 15)
82
- for chunk in iter_iterable:
83
  if chunk:
84
  f.write(chunk)
85
  return path
86
 
 
87
  # ---- 3段ヘッダ → 1枚目のみ採用/他はスキップ行数で読込 ----------------------
88
 
89
  HEADER_ROWS = [1, 2, 3] # 0行目は削除、1/2/3行目を列名として結合
 
78
  fname = guess_filename_from_headers(r, f"{pref}_{file_id}.xlsx")
79
  path = os.path.join(outdir, fname)
80
  with open(path, "wb") as f:
81
+ # ここを修正:通常の iter_content ループに
82
+ for chunk in r.iter_content(chunk_size=1 << 15):
83
  if chunk:
84
  f.write(chunk)
85
  return path
86
 
87
+
88
  # ---- 3段ヘッダ → 1枚目のみ採用/他はスキップ行数で読込 ----------------------
89
 
90
  HEADER_ROWS = [1, 2, 3] # 0行目は削除、1/2/3行目を列名として結合