{"action":"created","issue":{"url":"https://api.github.com/repos/abraham/twitteroauth/issues/465","repository_url":"https://api.github.com/repos/abraham/twitteroauth","labels_url":"https://api.github.com/repos/abraham/twitteroauth/issues/465/labels{/name}","comments_url":"https://api.github.com/repos/abraham/twitteroauth/issues/465/comments","events_url":"https://api.github.com/repos/abraham/twitteroauth/issues/465/events","html_url":"https://github.com/abraham/twitteroauth/issues/465","id":152594940,"number":465,"title":"Video from remote source","user":{"login":"Jack-JohnC","id":18579070,"avatar_url":"https://avatars.githubusercontent.com/u/18579070?v=3","gravatar_id":"","url":"https://api.github.com/users/Jack-JohnC","html_url":"https://github.com/Jack-JohnC","followers_url":"https://api.github.com/users/Jack-JohnC/followers","following_url":"https://api.github.com/users/Jack-JohnC/following{/other_user}","gists_url":"https://api.github.com/users/Jack-JohnC/gists{/gist_id}","starred_url":"https://api.github.com/users/Jack-JohnC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jack-JohnC/subscriptions","organizations_url":"https://api.github.com/users/Jack-JohnC/orgs","repos_url":"https://api.github.com/users/Jack-JohnC/repos","events_url":"https://api.github.com/users/Jack-JohnC/events{/privacy}","received_events_url":"https://api.github.com/users/Jack-JohnC/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-05-02T16:58:25Z","updated_at":"2016-05-03T17:38:08Z","closed_at":null,"body":"In TwitterOAuth.php line 269 total_bytes pulls the file source locally using filesize($parameters['media']) but doesn't allow from remote sources such as a CDN without first copying the file locally.\r\n\r\nIf you allow a parameter of total_bytes, the file can be pulled from a remote source just by posting the file size in bytes.\r\n\r\nCurrent:  `'total_bytes' => filesize($parameters['media'])`\r\n\r\nNew:  `'total_bytes' => isset($parameters['total_bytes']) ? $parameters['total_bytes'] : filesize($parameters['media'])`\r\n\r\nIf you want to take it further you can add in the remote file size in the API and do it automatically by specifying a remote file parameter.\r\n\r\n        $videoUrl = 'some remote url';\r\n        $ch = curl_init($videoUrl);\r\n        curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\r\n        curl_setopt($ch, CURLOPT_HEADER, TRUE);\r\n        curl_setopt($ch, CURLOPT_NOBODY, TRUE);\r\n        curl_exec($ch);\r\n        $sizeBytes = curl_getinfo($ch, CURLINFO_CONTENT_LENGTH_DOWNLOAD);\r\n        curl_close($ch);\r\n\r\nWhere `$sizeBytes` is total_bytes"},"comment":{"url":"https://api.github.com/repos/abraham/twitteroauth/issues/comments/216606853","html_url":"https://github.com/abraham/twitteroauth/issues/465#issuecomment-216606853","issue_url":"https://api.github.com/repos/abraham/twitteroauth/issues/465","id":216606853,"user":{"login":"abraham","id":3341,"avatar_url":"https://avatars.githubusercontent.com/u/3341?v=3","gravatar_id":"","url":"https://api.github.com/users/abraham","html_url":"https://github.com/abraham","followers_url":"https://api.github.com/users/abraham/followers","following_url":"https://api.github.com/users/abraham/following{/other_user}","gists_url":"https://api.github.com/users/abraham/gists{/gist_id}","starred_url":"https://api.github.com/users/abraham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abraham/subscriptions","organizations_url":"https://api.github.com/users/abraham/orgs","repos_url":"https://api.github.com/users/abraham/repos","events_url":"https://api.github.com/users/abraham/events{/privacy}","received_events_url":"https://api.github.com/users/abraham/received_events","type":"User","site_admin":false},"created_at":"2016-05-03T17:38:08Z","updated_at":"2016-05-03T17:38:08Z","body":"But how do you upload it to twitter?"}}