Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Endpoint to add youtube video returns an error #94

Closed
jalajcodes opened this issue Feb 21, 2021 · 11 comments
Closed

Bug: Endpoint to add youtube video returns an error #94

jalajcodes opened this issue Feb 21, 2021 · 11 comments
Labels
Category: Coding Changes to code base or refactored code that doesn't fix a bug.

Comments

@jalajcodes
Copy link
Member

Describe the bug

/videos/youtube endpoint returns 500 Internal server error

To Reproduce

Steps to reproduce the behavior:

  1. Start the server.
  2. Go to http://localhost:500
  3. Scroll down to video/youtube endpoint
  4. Fill in the required details and make the request.
  5. See error.

Expected behavior

The endpoint should create a new video.

Screenshots

image

Desktop (please complete the following information):

  • OS: any
  • Browser any
  • Version any

Smartphone (please complete the following information):

  • Device: any
  • OS: any
  • Browser any
  • Version any

Additional context

Check the terminal to find out the cause of the error.

@welcome
Copy link

welcome bot commented Feb 21, 2021

Hello there!👋 Welcome to the project!💖

Thank you and congrats🎉for opening your very first issue in this project. AnitaB.org is an inclusive community, committed to creating a safe and positive environment.🌸 Please adhere to our Code of Conduct.🙌 You may submit a PR if you like! If you want to report a bug🐞 please follow our Issue Template. Also make sure you include steps to reproduce it and be patient while we get back to you.😄

Feel free to join us on AnitaB.org Open Source Zulip Community.💖 We have different streams for each active repository for discussions.✨ Hope you have a great time there!😄

@jalajcodes jalajcodes changed the title Endpoint to add youtube video returns an error Bug: Endpoint to add youtube video returns an error Feb 21, 2021
@annabauza annabauza added Category: Coding Changes to code base or refactored code that doesn't fix a bug. Status: Available Issue was approved and available to claim or abandoned for over 3 days. labels Feb 21, 2021
@jalajcodes
Copy link
Member Author

jalajcodes commented Feb 21, 2021

@annabauza as the endpoint is working fine locally, so the problem must be with the deployed version. Can you confirm that the youtube API is enabled (#90) ?
Also, do you mind sharing the Heroku logs after sending the POST request?

@annabauza
Copy link
Contributor

@jalajcodes from url :https://www.youtube.com/watch?v=bVE9W73Qvzk
Error logs shows some wrong formats:

  • duration
  • free_to_reuse - this is Creative Commons video...

{'name': None, 'url': 'https://www.youtube.com/watch?v=bVE9W73Qvzk', 'preview_url': 'https://i.ytimg.com/vi/bVE9W73Qvzk/sddefault.jpg', 'title': 'AlterConf NYC 2017: Stem in Single-Gender Education, Stereotype Threat, and... by Elizabeth Yalkut', 'date_published': datetime.datetime(2017, 9, 11, 0, 0), 'source': 'YouTube', 'channel': 'Alter Conf', 'duration': '19M49S', 'archived': False, 'free_to_reuse': False, 'authorized_to_reuse': False}

@jalajcodes
Copy link
Member Author

jalajcodes commented Mar 2, 2021

@annabauza

  • what format do we want the duration to be?

    • 'duration': '19M49S' is what youtube returns by default...I can change it according to our needs.
  • So if a video is licensed as creative commons, free_to_reuse should be true?

    • what about authorized_to_reuse ?
  • As you are able to get the data from the endpoint, I think this issue should be closed and I can create another one for the above problems OR maybe update this one?

@annabauza
Copy link
Contributor

  1. seconds I think
  2. yes cc is should be free to use
  3. rules is free_to_reuse or authorized_to_reuse so if free_to_reuse is true authorized_to_reuse will not be checked and I think because no one personally authorised that to be reusable then it should be false by default.

@jalajcodes
Copy link
Member Author

  1. seconds I think
  2. yes cc is should be free to use
  3. rules is free_to_reuse or authorized_to_reuse so if free_to_reuse is true authorized_to_reuse will not be checked and I think because no one personally authorised that to be reusable then it should be false by default.

Thanks for clarifying...
Should I create a PR fixing this?

@NenadPantelic
Copy link
Contributor

NenadPantelic commented Mar 3, 2021

@jalajcodes If you're handling this, can I take #83 to complete the DB constraints? cc @annabauza @vatsalkul @keshakaneria

@annabauza
Copy link
Contributor

And who's looking after cors?

@jalajcodes
Copy link
Member Author

And who's looking after cors?

someone is assigned to that issue, they haven't created a pr yet

@Amulya-coder
Copy link
Member

@jalajcodes I will close this issue as it has been resolved by #119

@HeroicHitesh
Copy link
Member

@Amulya-coder Removing Open Source Hack Label as OSH will start on and/or after 1st April

@HeroicHitesh HeroicHitesh removed Open Source Hack Status: Available Issue was approved and available to claim or abandoned for over 3 days. labels Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Coding Changes to code base or refactored code that doesn't fix a bug.
Projects
None yet
Development

No branches or pull requests

5 participants