diff --git a/src/controllers/Recognitions.js b/src/controllers/Recognitions.js index b2e128e..23fe9cb 100644 --- a/src/controllers/Recognitions.js +++ b/src/controllers/Recognitions.js @@ -1,4 +1,4 @@ -const statusHashRgx = /video\/([^\/]+)(?:\/[^\/]+){3}\/([^\/?]+)/; +const statusHashRgx = /video\/([^\/]+)(?:\/[^\/]+){2,3}\/([^\/?]+)/; const Recognitions = require('../models/Recognitions'); class RecognitionsController { diff --git a/src/recognition/index.js b/src/recognition/index.js index 49b99ac..b7de36f 100644 --- a/src/recognition/index.js +++ b/src/recognition/index.js @@ -16,7 +16,6 @@ main = async () => { return twitter.replyTo(id, screenName, `twitter.com/me/status/${setRecognized}`); // Download Media - console.log('------ New Identification in progress... (twid: ' + tweet.id_str + ') ------') let tempFile = await download(mediaURL); if (tempFile === false) return console.log('Couldn\'t download media'); diff --git a/src/recognition/utils/twitter.js b/src/recognition/utils/twitter.js index c5e93bf..24f8696 100644 --- a/src/recognition/utils/twitter.js +++ b/src/recognition/utils/twitter.js @@ -123,10 +123,12 @@ class Twitter { const mediaURL = tweet.extended_entities.media[0].video_info.variants[0].url; for (let media of tweet.extended_entities.media[0].video_info.variants) if (media.content_type === 'video/mp4') { - console.log('x - '+media.url) + console.log('------ New Identification in progress... (twid: '+id+') ------'); + console.log('Media URL: ' + media.url) return media.url; } - console.log('y - '+mediaURL) + console.log('------ New Identification in progress... (twid: '+id+') ------'); + console.log('Media URL (fallback): ' + mediaURL) return mediaURL; }