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

parse youtube link #406

Open
ipatovanton opened this issue Apr 5, 2018 · 3 comments
Open

parse youtube link #406

ipatovanton opened this issue Apr 5, 2018 · 3 comments
Assignees

Comments

@ipatovanton
Copy link

ipatovanton commented Apr 5, 2018

If I parse youtube link
I have this error:
undefined method `image' for #Feedjira::Parser::AtomYoutubeEntry:0x00007fa14be348d0

other links work

my code:

def self.add_entries(entries, stream_id)
      entries.each do |entry|
          unless  FeedEntry.where(guid: entry.id).exists?
            FeedEntry.create!(
              :name          => entry.title,
              :url           => entry.url,
              :summary       => entry.summary,
              :published_at  => entry.published,
              :enclosure_url => entry.image,
              :enclosure_type => entry.enclosure_type,
              :guid          => entry.id,
              :source_id => stream_id
            )
          end
      end
end

How to make to parse all links?

@PascalTurbo
Copy link

Have a look at my answer on Stackoverflow.
If you think this might be a bug, please provide us with some sample code including the sourcecode / url of a youtube feed for testing purposes.

@PascalTurbo PascalTurbo self-assigned this Apr 5, 2018
@ipatovanton
Copy link
Author

I think that instead of

element :"media:thumbnail", as: :media_thumbnail_url, value: :url
element :"media:thumbnail", as: :media_thumbnail_width, value: :width
element :"media:thumbnail", as: :media_thumbnail_height, value: :height

should be

element :"media:thumbnail", as: :image, value: :url
element :"media:thumbnail", as: :image, value: :width
element :"media:thumbnail", as: :image, value: :height

as in other parsers
#408

@PascalTurbo
Copy link

@mikeastock @HParker feedjira doesn't map values consequently. For "standard" feeds like feedburner or rss media:content is mapped to ìmage`, for itunes it is mapped to itunes_image.
I think we should normalize this to image, but first with 3.0 because compatibility is not given.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants