从iPhone中的不同视频站点下载视频 [英] downloading videos from different video sites in iPhone

查看:48
本文介绍了从iPhone中的不同视频站点下载视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,用户可以从bofunk.com,dailymotion.com,youtube.com,metacafe.com,stupid videos.com等不同的视频网站下载和播放视频。从不同的网站下载视频的背后的想法是什么.i实现了一种方法,并在某些站点上有效。即通过从html字符串生成可下载的url。但是此方法在其他站点上却无效。任何人都可以指导我吗?已经尝试过并且正在为bofunk.com工作

in my application,user can download and play videos from different video sites like bofunk.com,dailymotion.com,youtube.com,metacafe.com,stupid videos.com etc.what is the idea behind downloading videos from different sites.i implemented a method and is working for some sites.That is by generating a downloadable url from the html string.But this same method is not working for other sites.Can anyone guide me o this?thanks in advance.This is what i have tried and is working for bofunk.com

`-(BOOL)searchForVideoInBOFUNKHTML:(NSString*)htmlString;
{
    NSString *strHTML=[NSString stringWithFormat:@"%@",htmlString];       
    NSString *newString; 

    if ([htmlString rangeOfString:@"id=\"vidplaya\""].location == NSNotFound) 
    {
        return  false;
    }   
    else
    {
        htmlString = [strHTML substringFromIndex:[htmlString rangeOfString:@"id=\"vidplaya\""].location];

        htmlString=  [htmlString stringByReplacingOccurrencesOfString:[htmlString substringFromIndex:100]
                                                        withString:@""];



            newString =[htmlString stringByReplacingOccurrencesOfString:[htmlString substringFromIndex:[htmlString rangeOfString:@"quality"].location] withString:@""];
        NSLog(@"%@",newString);

            newString = [[[newString substringFromIndex:[newString rangeOfString:@"/"].location] substringFromIndex:3] stringByReplacingOccurrencesOfString:@"\"" withString:@""];
         NSLog(@"%@",newString);

            newString = [newString stringByReplacingOccurrencesOfString:@" " withString:@""];
         NSLog(@"%@",newString);


            embededURL = [[NSString alloc] initWithFormat:@"http://media.bofunk.com/media/flvs/%@.flv",newString]; 

        NSLog(@"%@",embededURL);
            return true;

    }
    return  false;

}

`但不适用于Dailymotion.com等网站,是否与任何加密方式有关?这些网站?

`But is not working for sites like dailymotion.com.Is it an issue related to any kind of encryption on these sites?

推荐答案

Dailymotion提供了 iOS版API 。因此您可以使用它。但是不要期望它可以与其他服务一起使用。您将必须一一实现它们。其中一些可能无法与外部软件一起使用。

Dailymotion provides an API for iOS. So you can use it. But don't expect it to work with other services. You will have to implement them all one by one. Some of them might be impossible to use with external software.

这篇关于从iPhone中的不同视频站点下载视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆