how to get file included data as string?

Started on the old forum in September 2013 · view the original in the archive · old links redirect here

7 replies · 911 views · started 13 years ago · 1 min read

2 participants
charith7788 Developer · 51 posts #1

i've got a small file which gives the urlencoded variables with values in comma separated pattern(given below), i want to read it as working seperated string variable from given separated comma pattern as a list of urls, how does it make?

Attachments: get_.txt
softwarefreak Senior · 349 posts #2

charith7788 wrote: i've got a small file which gives the urlencoded variables with values in comma separated pattern(given below), i want to read it as working seperated string variable from given separated comma pattern as a list of urls, how does it make?

Get the contents of the file in a variable

$file = file_get_contents('get_.txt');

explode them w/ the delimer

$urls = explode(',', $file);
unset($file);

Now you've have each url in the array $urls, use foreach loop if you wana list them

foreach($urls as $url) {
echo $url . "\n";
}

I need some facebook likes, can you please help me 🤝 http://facebook.com/softwarefreakin I noticed social media is really powerful 🧙 Well DONE is better than well SAID

charith7788 Developer · 51 posts #3

softwarefreak wrote: Get the contents of the file in a variable

$file = file_get_contents('get_.txt');

explode them w/ the delimer

$urls = explode(',', $file);
unset($file);

Now you've have each url in the array $urls, use foreach loop if you wana list them

foreach($urls as $url) {
echo $url . "\n";
}

thanks bro. I'll check that, will the file open if it is in a remote location? I got get.text from www.youtube.com/get_video_info?video_id=xxxx does the file_get_contents function work with the url?

softwarefreak Senior · 349 posts #7

charith7788 wrote: can we send our IP to the youtube? it is sending my server IP

The thing you want to do is known as IP spoofing, you can pass user ip via curl but that wont work cuz your server is the bridge between the user & youtube, youtube will send the data back to ip who sends the request, if its not your server ip, then you'll never get the data

I need some facebook likes, can you please help me 🤝 http://facebook.com/softwarefreakin I noticed social media is really powerful 🧙 Well DONE is better than well SAID

charith7788 Developer · 51 posts #8

softwarefreak wrote: The thing you want to do is known as IP spoofing, you can pass user ip via curl but that wont work cuz your server is the bridge between the user & youtube, youtube will send the data back to ip who sends the request, if its not your server ip, then you'll never get the data

yes its true, i got the data (download links as 3gp mp4 flv webm ,stream url,thumbanail url,..ect ) with server ip. but all the given download links are created with server ip, so i want to download the videos but youtube don't let me to download, becouse download request sends by my ip, then 1st & 2nd ips are different so that download link is not working by my side, thats why i want to spoof my ip through curl, file get contens function also sends server url. Have any idea?

Added after 20 minutes:

softwarefreak wrote: The thing you want to do is known as IP spoofing, you can pass user ip via curl but that wont work cuz your server is the bridge between the user & youtube, youtube will send the data back to ip who sends the request, if its not your server ip, then you'll never get the data

i have to pass my browser ip through curl or open the download link with curl but 2nd idea is depends on video length & eat server bandwidth,

Added after 2 minutes:

softwarefreak wrote: The thing you want to do is known as IP spoofing, you can pass user ip via curl but that wont work cuz your server is the bridge between the user & youtube, youtube will send the data back to ip who sends the request, if its not your server ip, then you'll never get the data

some sites doing that job correctly eg : ssyoutube.com i want to build site like that

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close