Skip to content

Commit

Permalink
Merge pull request #29 from ConvertAPI/feature/format-auto-detection
Browse files Browse the repository at this point in the history
Fix format auto-detector
  • Loading branch information
laurynas-convertapi committed Sep 12, 2022
2 parents f39f148 + 10a1095 commit 6406858
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ coverage.xml
# Sphinx documentation
docs/_build/

.python-version
5 changes: 4 additions & 1 deletion convertapi/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from convertapi import file_param, format_detector, utils
from .result import Result

DEFAULT_URL_FORMAT = 'url'
DEFAULT_URL_FORMAT = 'web'

class Task:
def __init__(self, from_format, to_format, params, timeout = None):
Expand Down Expand Up @@ -50,6 +50,9 @@ def __normalize_params(self):
return params

def __detect_format(self):
if str(self.to_format).lower() == 'zip':
return 'any'

if 'Url' in self.params:
return DEFAULT_URL_FORMAT

Expand Down

0 comments on commit 6406858

Please sign in to comment.