Skip to content

Commit

Permalink
Merge pull request #672 from gpchelkin/master
Browse files Browse the repository at this point in the history
  • Loading branch information
gpchelkin authored Dec 18, 2022
2 parents 2cb1829 + b1c1396 commit b42a32a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
poetry config installer.parallel true
- name: Publish tagged release
- name: Publish release
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.POETRY_PYPI_TOKEN_PYPI }}
run: |
Expand Down
10 changes: 6 additions & 4 deletions scdlbot/scdlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,10 @@ def prepare_urls(self, message, mode=None, source_ip=None, proxy=None, apologize

urls_dict = {}
for url_item in urls:
url = url_item
# unshorten soundcloud.app.goo.gl and other links, but not tiktok or instagram:
if not ("tiktok" in url_item.host or "instagr" in url_item.host):
# unshorten soundcloud.app.goo.gl and other links, but not tiktok or instagram or youtube:
if "tiktok" in url_item.host or "instagr" in url_item.host or self.SITES["yt"] in url_item.host:
url = url_item
else:
try:
url = URL(
requests.head(
Expand All @@ -409,7 +410,7 @@ def prepare_urls(self, message, mode=None, source_ip=None, proxy=None, apologize
).url
)
except:
pass
url = url_item
url_text = url.to_text(True)
# FIXME crutch:
url_text = url_text.replace("m.soundcloud.com", "soundcloud.com")
Expand Down Expand Up @@ -576,6 +577,7 @@ def download_url_and_send(self, bot, url, direct_urls, chat_id, reply_to_message
},
# {'key': 'EmbedThumbnail',}, {'key': 'FFmpegMetadata',},
],
"noplaylist": True,
}
if proxy:
ydl_opts["proxy"] = proxy
Expand Down

0 comments on commit b42a32a

Please sign in to comment.