• Welcome to PHPVIBE Forums. Please log in.

[ Video Sharing CMS v4 ] A Way To Import Youtube Videos So Newest = First

Started by lowpage,

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

lowpageTopic starter

I'm trying to see if there is a way to import youtube so that the date of newest videos are at front of site...it would reverse the automated way. O0
  •  

Hersh

I have also noticed this the other day. I haven't tried fix it but suffice it to say this is important. I don't understand how it makes sense to design the software to import videos in the opposite order.
  •  

Marius P.

Guys, this is the natural order Youtube api returns results.
You can select "Published", but it will still return newest first.
The php wrapper just uses Youtube api, and provides the same options they make available.
At the moment you can't even tell the exact number of results Youtube api will return/allow return to make it reverse from last page to first page (considering an published query).
This are things Youtube has to give an hand with, not us. I hope this 3.0 version of their api will bring some more on the next upgrade.
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

lowpageTopic starter

  •  

PHPVibe A.


Hersh

I've already done this with my script. It is not that difficult. For 1by1, you can reverse it during POST. For automated import, you use the "end page" field as a start page and import the videos in reverse from the last page to first. The only (minor) problem is, you have to flip the order of videos for auto import so that the oldest is at the top and newest is at the bottom. But really, who cares so long as the videos are importing in the correct order.
  •  

lowpageTopic starter

Quote from: Hersh on
I've already done this with my script. It is not that difficult. For 1by1, you can reverse it during POST. For automated import, you use the "end page" field as a start page and import the videos in reverse from the last page to first. The only (minor) problem is, you have to flip the order of videos for auto import so that the oldest is at the top and newest is at the bottom. But really, who cares so long as the videos are importing in the correct order.

Kindly explain this to me like a small child...Also i am importing from a specific channel thanks
  •  

Marius P.

Quote from: Hersh on
I've already done this with my script. It is not that difficult. For 1by1, you can reverse it during POST. For automated import, you use the "end page" field as a start page and import the videos in reverse from the last page to first. The only (minor) problem is, you have to flip the order of videos for auto import so that the oldest is at the top and newest is at the bottom. But really, who cares so long as the videos are importing in the correct order.

I have only one dilemma here, how do you get the last page? Am I missing something, did they change the API? Cause before the exact number of results displayed/returned/available was a dilemma....so how do you get the last page to reverse?
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

Hersh

Quote from: @Mario on
I have only one dilemma here, how do you get the last page? Am I missing something, did they change the API? Cause before the exact number of results displayed/returned/available was a dilemma....so how do you get the last page to reverse?

You are right, there is no way to determine the end page of yt search results. I did not change the order of results to make the last page the first page. That would be problematic. Instead, I use the the end page for "auto push" (e.g. page 20) as the starting point and import videos backwards from the last page to first. Of course, there are some situations where the end page you specify might be greater than the number of pages with results. For this, you can either manually reduce the number of pages, or use the no results as a trigger to paginate backwards until you get to a page with results, then you can import them until you get to page 1. I haven't done this last part yet, but everything else works like a charm.

I have also started importing the upload date and view count of videos to give content a realistic chronology. I think this is important. I had some difficulty capturing likes and dislikes from the API so I decided to calculate these values by dividing view count by a variable range of random numbers.
  •  

spanraj

Dear Alex,

I tried the version 4 and imported the videos. but all videos coming first is old.
is there is any way to fix this.

If please keep a option on home page, sort by data using Ascending or descending order.

Please Advise.
  •  

PHPVibe A.

Hi, there is no way to retrieve this without unstable changes in the code.
This is the natural order of the Youtube API, and the only options are the ones already in the importer.

Similar topics (7)