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

Can't fetch twitter metadata in upload page & bookmarklet #3850

Closed
nonamethanks opened this issue Aug 29, 2018 · 8 comments
Closed

Can't fetch twitter metadata in upload page & bookmarklet #3850

nonamethanks opened this issue Aug 29, 2018 · 8 comments

Comments

@nonamethanks
Copy link
Member

Returns a "This feature isn't available: NotImplementedError" alert.

/var/www/danbooru2/releases/20180829182924/app/logical/sources/strategies/base.rb:78:
in `artist_name'","/var/www/danbooru2/releases/20180829182924/app/logical/sources/strategies/base.rb:183:
in `to_h'","/var/www/danbooru2/releases/20180829182924/app/controllers/sources_controller.rb:7:
in `show'","/var/www/danbooru2/shared/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_controller/metal/basic_implicit_render.rb:6
<code snipped>
@evazion
Copy link
Member

evazion commented Aug 29, 2018

Works when using the bookmarklet on the html page. Doesn't work when using it on the image.

@nonamethanks
Copy link
Member Author

@evazion
Copy link
Member

evazion commented Aug 29, 2018

Looks like a combination of several issues:

  • The /source.json call isn't getting the referer passed in.
  • The twitter strategy had a typo that kept it from matching direct twitter images without a referer. The null strategy was getting chosen instead.
  • The null strategy errors out inside /source.json.

@r888888888
Copy link
Collaborator

@nonamethanks I assume your version of the bookmarklet sets the ref parameter, and it's set to the status page. Pasting what the bookmarklet redirects you to would be useful.

@nonamethanks
Copy link
Member Author

The link I posted above returns this kind of upload page. Aren't they the same for everyone? I thought they were generated server-side.

@r888888888
Copy link
Collaborator

Some additional fixes in ab220f2 and eac5a57 have been deployed.

@evazion
Copy link
Member

evazion commented Aug 29, 2018

ab220f2 has a new bug: if you don't use the bookmarklet, and you paste an url into the source field manually, then the Fetch source data button won't do anything. In this case the #url field gets chosen before the #upload_source field, but the field is blank so it does nothing.

EDIT: fixed in cd11ae6.

evazion added a commit that referenced this issue Aug 29, 2018
* #upload_referer_url no longer exists, just using #ref works.
* #upload_source defaults to params[:url], so using it instead of #url still works.

ref: #3850 (comment)
@evazion
Copy link
Member

evazion commented Aug 30, 2018

I think this is working now.

@evazion evazion closed this as completed Aug 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants