jazzband / django-embed-video

Django app for easy embedding YouTube and Vimeo videos and music from SoundCloud.
http://django-embed-video.rtfd.org
MIT License
382 stars 135 forks source link

SoundCloud not working #30

Closed Calzzetta closed 10 years ago

Calzzetta commented 10 years ago

I was using django-embed-video with SoundCloud and it isn't working anymore.

The SoundCloud url example: https://soundcloud.com/the-bugle/the-bugle-summer-break-1

Template:

{% for music in disc.musics %}
 {% video music.url as my_music %}
   {% video my_music "small" %}
 {% endvideo %}
{% endfor %}
yetty commented 10 years ago

It works fine for me. Are you running on HTTPS?

Calzzetta commented 10 years ago

I am using the debug server provided by Django. The exception that appears is: Attempt to render not existing video (https://soundcloud.com/the-bugle/the-bugle-summer-break-1)

yetty commented 10 years ago

I failed in trying to reproduce it. Can you provide full stacktrace of the exception?

yetty commented 10 years ago

You can also try write out response of SoundCloud. It is on the lines 291-297 in backends.py

https://github.com/yetty/django-embed-video/blob/2b7308e8eab29ea1ef8a01d8450596aa4e534ef7/embed_video/backends.py#L294

Calzzetta commented 10 years ago

On the params I have: {'url': 'https://soundcloud.com/the-bugle/the-bugle-summer-break-1', 'format': 'json'}

Base URL: https://soundcloud.com/oembed

Response is error 400: SoundCloud returned status code '400'.

Request attributes:

method = GET
url = http://soundcloud.com/oembed
headers = {}
files = []
data = {'url': 'https://soundcloud.com/karenito/sanshin-no-hana', 'format': 'json'}
params = {}
auth = None
cookies = None
yetty commented 10 years ago

It seems really similar to #28. Instead of filled data should be filled params.

What version of django-embed-video do you use? Try to upgrade to develop version from git. This fix hasn't been released yet.

yetty commented 10 years ago

@Calzzetta, I'm closing this issue, feel free to reopen it, if previouse comment didn't help.

sunjoomoon commented 9 years ago

I had the same issue, and following below worked just cool. Many thanks.

You can also try write out response of SoundCloud. It is on the lines 291-297 in backends.py

https://github.com/yetty/django-embed-video/blob/2b7308e8eab29ea1ef8a01d8450596aa4e534ef7/embed_video/backends.py#L294