Skip to content

Commit

Permalink
fix google download
Browse files Browse the repository at this point in the history
  • Loading branch information
teticio committed Feb 10, 2024
1 parent 5dca609 commit 7eddd7e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ def download_file_from_google_drive(file_id, destination, size):
params = {'export': 'dowloand', 'id': file_id, 'confirm': 't'}
response = session.get(url, params=params, stream=True)

soup = BeautifulSoup(response.text, 'html.parser')
form = soup.find('form')
if form:
if 'text/html' in response.headers.get('Content-Type'):
soup = BeautifulSoup(response.text, 'html.parser')
form = soup.find('form')
url = form['action']
inputs = form.find_all('input')
params = {input['name']: input.get('value', '') for input in inputs if input.get('name')}
Expand Down

0 comments on commit 7eddd7e

Please sign in to comment.