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

Fix orphaned embedded video links from Tumblr. Fix #3177 #3181

Closed
wants to merge 1 commit into from

Conversation

willthong
Copy link
Contributor

Where a Tumblr video links to an orphaned video (eg https://www.tumblr.com/boxydog/148936576299/two-opposite-personalities-one-driven-to-big), pelican-import crashes as it tries to define a players variable from a "player" record in Tumblr's JSON API output which doesn't exist.

Pull Request Checklist

Resolves: #3177

  • Ensured tests pass and (if applicable) updated functional test output
  • Conformed to code style guidelines by running appropriate linting tools
  • Added tests for changed code
  • Updated documentation for changed code

@boxydog
Copy link
Contributor

boxydog commented Oct 25, 2023

It's been two months. What's blocking this merge? Is it documentation? Is there something I can do?

@justinmayer
Copy link
Member

justinmayer commented Oct 25, 2023

It’s just been a busy period. I appreciate the offer to help out. There is a Pelican sprint planned for this weekend, so this PR will be merged then if not sooner. Feel free to join us this weekend if you’d like to collaborate and work on Pelican together. 🌟

try:
players = '\n'.join(player.get('embed_code')
for player in post.get('player'))
except TypeError:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does work. My question is: is it okay to fail silently, or should there at least be something in the output that says "Video missing" or "Video removed" or something?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. There should probably be a line here with something like:

logger.warning(f"Video not imported due to broken embedded video links: {some-appropriate-variable}")

What do you think, @willthong?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was actually thinking something in the generated output.

If I'm importing 100 posts, I'm not going to know which one broke, and I'm not looking too closely at warnings.

I'd be willing to work on this, but only after #3215 is merged (to get the unit testing setup).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would indeed be clearer. Thanks for offering to work on this. I just merged 3215. 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put up a new PR #3218, based on this one.

@justinmayer
Copy link
Member

Merged via #3218. Many thanks for your help with this, Will! 💫

@willthong willthong deleted the fix-tumblr-import branch November 1, 2023 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pelican import fails on tumblr blog entry
3 participants