Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Mobile enhancements.

  • Loading branch information...
commit 52de7bafc4495cad94ed1ae1e606be1bd020a89b 1 parent f81c6b9
@livid authored
View
79 main.py
@@ -96,29 +96,6 @@ def get(self):
i = i + 1
memcache.set('home_nodes_new', nodes_new, 86400)
template_values['nodes_new'] = nodes_new
- if browser['ios']:
- s = ''
- s = memcache.get('home_sections_neue')
- if (s == None):
- s = ''
- q = db.GqlQuery("SELECT * FROM Section ORDER BY created ASC")
- if (q.count() > 0):
- for section in q:
- q2 = db.GqlQuery("SELECT * FROM Node WHERE section_num = :1 ORDER BY created ASC", section.num)
- n = ''
- if (q2.count() > 0):
- nodes = []
- i = 0
- for node in q2:
- nodes.append(node)
- i = i + 1
- random.shuffle(nodes)
- for node in nodes:
- fs = random.randrange(12, 16)
- n = n + '<a href="/go/' + node.name + '" style="font-size: ' + str(fs) + 'px;">' + node.title + '</a>&nbsp; '
- s = s + '<div class="section">' + section.title + '</div><div class="cell">' + n + '</div>'
- memcache.set('home_sections_neue', s, 86400)
- template_values['s'] = s
ignored = ['newbie', 'in', 'flamewar', 'pointless', 'tuan', '528491', 'chamber', 'autistic', 'blog', 'love', 'flood', 'beforesunrise', 'diary']
if browser['ios']:
home_rendered = memcache.get('home_rendered_mobile')
@@ -185,39 +162,35 @@ def get(self):
reply_total = 0
memcache.set('reply_total', reply_total, 3600)
template_values['reply_total'] = reply_total
+ hottest = memcache.get('index_hottest_sidebar')
+ if hottest is None:
+ qhot = db.GqlQuery("SELECT * FROM Node ORDER BY topics DESC LIMIT 25")
+ hottest = u''
+ for node in qhot:
+ hottest = hottest + '<a href="/go/' + node.name + '" class="item_node">' + node.title + '</a>'
+ memcache.set('index_hottest_sidebar', hottest, 86400)
+ template_values['index_hottest_sidebar'] = hottest
+ c = memcache.get('index_categories')
+ if c is None:
+ c = ''
+ i = 0
+ if site.home_categories is not None:
+ categories = site.home_categories.split("\n")
+ else:
+ categories = []
+ for category in categories:
+ category = category.strip()
+ i = i + 1
+ c = c + '<div class="cell"><table cellpadding="0" cellspacing="0" border="0"><tr><td align="right" width="60"><span class="fade">' + category + '</span></td><td style="line-height: 200%; padding-left: 10px;">'
+ qx = db.GqlQuery("SELECT * FROM Node WHERE category = :1 ORDER BY topics DESC", category)
+ for node in qx:
+ c = c + '<a href="/go/' + node.name + '" style="font-size: 14px;">' + node.title + '</a>&nbsp; &nbsp; '
+ c = c + '</td></tr></table></div>'
+ memcache.set('index_categories', c, 86400)
+ template_values['c'] = c
if (browser['ios']):
path = os.path.join(os.path.dirname(__file__), 'tpl', 'mobile', 'index.html')
else:
- hottest = memcache.get('index_hottest_sidebar')
- if hottest is None:
- qhot = db.GqlQuery("SELECT * FROM Node ORDER BY topics DESC LIMIT 25")
- hottest = u''
- for node in qhot:
- hottest = hottest + '<a href="/go/' + node.name + '" class="item_node">' + node.title + '</a>'
- memcache.set('index_hottest_sidebar', hottest, 86400)
- template_values['index_hottest_sidebar'] = hottest
- c = memcache.get('index_categories')
- if c is None:
- c = ''
- i = 0
- if site.home_categories is not None:
- categories = site.home_categories.split("\n")
- else:
- categories = []
- for category in categories:
- category = category.strip()
- i = i + 1
- if i == len(categories):
- css_class = 'inner'
- else:
- css_class = 'cell'
- c = c + '<div class="' + css_class + '"><table cellpadding="0" cellspacing="0" border="0"><tr><td align="right" width="60"><span class="fade">' + category + '</span></td><td style="line-height: 200%; padding-left: 15px;">'
- qx = db.GqlQuery("SELECT * FROM Node WHERE category = :1 ORDER BY topics DESC", category)
- for node in qx:
- c = c + '<a href="/go/' + node.name + '" style="font-size: 14px;">' + node.title + '</a>&nbsp; &nbsp; '
- c = c + '</td></tr></table></div>'
- memcache.set('index_categories', c, 86400)
- template_values['c'] = c
path = os.path.join(os.path.dirname(__file__), 'tpl', 'desktop', 'index.html')
output = template.render(path, template_values)
self.response.out.write(output)
View
2  notifications.py
@@ -71,7 +71,7 @@ def get(self):
memcache.set('nn::' + self.member.username_lower, notifications, 360)
self.values['notifications'] = notifications
self.set_title(u'提醒系统')
- self.finalize(template_name='notifications')
+ self.finalize(template_name='notifications', mobile_optimized=True)
else:
self.redirect('/signin')
View
19 static/css/mobile/style.css
@@ -62,7 +62,7 @@ a.black:link, a.black:visited, a.black:active {
a.black:hover {
color: rgba(0, 0, 0, 1);
text-decoration: underline;
- text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.2);
+ text-shadow: 0px 1px 0px rgba(255, 255, 255, 0.2);
}
form {
@@ -193,7 +193,7 @@ h1 {
color: #333;
font-weight: bold;
padding: 3px 5px 5px 5px;
- text-shadow: 0px 1px 1px rgba(255, 255, 255, 1);
+ text-shadow: 0px 1px 0px rgba(255, 255, 255, 1);
}
.cell {
@@ -362,6 +362,10 @@ td.avatar_mini {
outline: none;
}
+.fl {
+ float: left;
+}
+
.fr {
float: right;
}
@@ -437,6 +441,17 @@ input.btn {
color: #333;
}
+.payload {
+ display: inline-block;
+ background-color: #f5f5f5;
+ padding: 5px 10px 5px 10px;
+ font-size: 14px;
+ line-height: 120%;
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+}
+
/* High Resolution (iPhone 4) */
@media only screen and (-webkit-min-device-pixel-ratio: 2) {
View
49 tpl/desktop/advertisers.html
@@ -22,8 +22,55 @@ <h1 style="padding-top: 0px;">Advertisers</h1>
<div class="cell">
<strong>Promoted by <a href="http://www.3cpeijian.com/" target="_blank" onClick="recordOutboundLink(this, 'Outbound Links', '3cpeijian.com');">3C 配件网</a></strong>
<div clas="sep5"></div>
- <strong class="fade">Reserved</strong>
+ <strong class="fade">Reserved from 1/8 to 1/17</strong>
<div class="sep5"></div>
+ C 配件网( <a href="http://www.3cpeijian.com/" target="_blank">www.3cpeijian.com</a> )是一家专营 3C 数码配件,全球集约式采购分销零售的线上商城。<br /><br />
+ 公司名称为北京创造世纪商贸有限公司,2011 年 1 月获得美国 Ten One Design 大中华区总经销代理其品牌下 fling / fling mini / pogo sketch / pogo sketch pro 产品。2011 年 5 月获得美国 Hub international 大中华区总经销代理其品牌下 handstand 产品。2011 年 11 月公司决定创建 3C 配件网,致力于网络零售与分销海外品牌营销。
+ <div class="sep20"></div>
+ <table cellpadding="10" cellspacing="0" border="0" width="100%">
+ <tr>
+ <td width="33%" valign="top">
+ <a href="http://3cpeijianwang.taobao.com/" target="_blank" onClick="recordOutboundLink(this, 'Outbound Links', 'taobao.com');"><img src="http://static.v2ex.com/banners/3c1.png" border="0" width="120" height="90" alt="pogo sketch pro" /></a>
+ <div class="sep5"></div>
+ <span style="font-size: 11px; color: #666;">
+ <strong style="color: #000;"><a href="http://3cpeijianwang.taobao.com/" class="black" target="_blank" onClick="recordOutboundLink(this, 'Outbound Links', 'taobao.com');">pogo sketch pro • 杰作,由此诞生</a></strong><div class="sep3"></div><span style="font-size: 12px;">一只精致的手写笔,它适用于任何角度,你有你自己的书写方式。全新的具有专利的笔头,让你随意更换,一定会是最适合你的。</span>
+ </span>
+ </td>
+ <td width="34%" valign="top">
+ <a href="http://3cpeijianwang.taobao.com/" target="_blank" onClick="recordOutboundLink(this, 'Outbound Links', 'taobao.com');"><img src="http://static.v2ex.com/banners/3c2.png" border="0" width="120" height="90" alt="pogo sketch" /></a>
+ <div class="sep5"></div>
+ <span style="font-size: 11px; color: #666;">
+ <strong style="color: #000;"><a href="http://3cpeijianwang.taobao.com/" class="black" target="_blank" onClick="recordOutboundLink(this, 'Outbound Links', 'taobao.com');">pogo sketch • 把触摸板变成绘画板!</a></strong><div class="sep3"></div><span style="font-size: 12px;">全新设计的金属夹子能够完美夹入口袋或 iPad 后壳。轻松的玩游戏、绘画、写字,你可以用 iPad 做更多的事情。泡沫笔端柔软,但牢固耐用,适合多种触摸屏。</span>
+ </span>
+ </td>
+ <td width="33%" valign="top">
+ <a href="http://3cpeijianwang.taobao.com/" target="_blank" onClick="recordOutboundLink(this, 'Outbound Links', 'taobao.com');"><img src="http://static.v2ex.com/banners/3c3.png" border="0" width="120" height="90" alt="fling" /></a>
+ <div class="sep5"></div>
+ <span style="font-size: 11px; color: #666;">
+ <strong style="color: #000;"><a href="http://3cpeijianwang.taobao.com/" class="black" target="_blank" onClick="recordOutboundLink(this, 'Outbound Links', 'taobao.com');">fling • 想念你玩游戏时的操作摇杆?</a></strong><div class="sep3"></div><span style="font-size: 12px;">fling 是由如丝般光滑的树脂制作,不够巴掌大小的 fling 弹性十足,获得了 Macworld Best Show 大奖。它已经完全可以让你忘却 PSP 了。</span>
+ </span>
+ </td>
+ </tr>
+ <tr>
+ <td width="33%" valign="top">
+ <a href="http://3cpeijianwang.taobao.com/" target="_blank" onClick="recordOutboundLink(this, 'Outbound Links', 'taobao.com');"><img src="http://static.v2ex.com/banners/3c4.png" border="0" width="120" height="90" alt="fling mini" /></a>
+ <div class="sep5"></div>
+ <span style="font-size: 11px; color: #666;">
+ <strong style="color: #000;"><a href="http://3cpeijianwang.taobao.com/" class="black" target="_blank" onClick="recordOutboundLink(this, 'Outbound Links', 'taobao.com');">fling mini • 手机游戏原来可以这么玩</a></strong><div class="sep3"></div><span style="font-size: 12px;">支持数百种游戏:KOF,FIFA 让你在手机种找回街机的快感。多终端、多系统支持:Android、iOS 还是 Windows Phone、平板电脑?不用担心,它都能胜任!</span>
+ </span>
+ </td>
+ <td width="34%" valign="top">
+ <a href="http://3cpeijian.com/" target="_blank" onClick="recordOutboundLink(this, 'Outbound Links', 'iphoto.ly');"><img src="http://static.v2ex.com/banners/3c5.png" border="0" width="120" height="90" alt="3C 配件网" /></a>
+ <div class="sep5"></div>
+ <span style="font-size: 11px; color: #666;">
+ <strong style="color: #000;"><a href="http://3cpeijian.com/" class="black" target="_blank" onClick="recordOutboundLink(this, 'Outbound Links', '3cpeijian.com');">3C 配件网</a></strong><div class="sep3"></div><span style="font-size: 12px;">3C 配件网( <a href="http://3cpeijian.com/" target="_blank">www.3cpeijian.com</a> )是一家专营 3C 数码配件,全球集约式采购分销零售的线上商城。</span>
+ </span>
+ </td>
+ <td width="33%" valign="top">
+
+ </td>
+ </tr>
+ </table>
</div>
<div class="cell">
<strong>Promoted by <a href="http://www.appletuan.com/?utm_source=v2ex&utm_medium=banner&utm_campaign=V2EX" target="_blank" onClick="recordOutboundLink(this, 'Outbound Links', 'appletuan.com');">苹果团</a></strong>
View
4 tpl/desktop/common/bottom.html
@@ -1,7 +1,7 @@
<div id="Bottom">
- <div id="BottomMain"><div class="fr" align="right"><a href="http://www.linode.com/?r=af313ea8a6bb6f99aff800c67349cabbfee2682f" target="_blank"><img src="/static/img/linode.png" border="0" alt="Linode" /></a><div class="sep10"></div><strong><a href="http://www.linode.com/?r=af313ea8a6bb6f99aff800c67349cabbfee2682f" target="_blank">Linode - 互联网上最好的云主机</a></strong>
+ <div id="BottomMain"><div class="fr" align="right"><a href="http://www.linode.com/?r=af313ea8a6bb6f99aff800c67349cabbfee2682f" target="_blank"><img src="http://static.v2ex.com/logos/linode.png" border="0" alt="Linode" /></a><div class="sep10"></div><strong><a href="http://www.linode.com/?r=af313ea8a6bb6f99aff800c67349cabbfee2682f" target="_blank">Linode - 互联网上最好的云主机</a></strong>
</div>
- <strong><a href="/about" class="dark">关于</a></strong> &nbsp; | &nbsp; <strong><a href="/faq" class="dark">FAQ</a></strong> &nbsp; | &nbsp; <strong><a href="/mission" class="dark">我们的愿景</a></strong> &nbsp; | &nbsp; <strong><a href="/advertise" class="dark">广告投放</a></strong> &nbsp; | &nbsp; <strong><a href="https://workspace.v2ex.com/" class="dark" target="_blank">{{ l10n.workspace }}</a></strong> &nbsp; | &nbsp; <strong><a href="http://www.v2ex.com/start" class="dark" target="_blank">上网首页</a></strong>
+ <strong><a href="/about" class="dark">关于</a></strong> &nbsp; | &nbsp; <strong><a href="/faq" class="dark">FAQ</a></strong> &nbsp; | &nbsp; <strong><a href="/mission" class="dark">我们的愿景</a></strong> &nbsp; | &nbsp; <strong><a href="/advertise" class="dark">广告投放</a></strong> &nbsp; | &nbsp; <strong><a href="https://workspace.v2ex.com/" class="dark" target="_blank">{{ l10n.workspace }}</a></strong> &nbsp; | &nbsp; <strong><a href="http://www.v2ex.com/gadgetlab" class="dark">Gadget Lab</a></strong> &nbsp; | &nbsp; <strong><a href="http://www.v2ex.com/start" class="dark" target="_blank">上网首页</a></strong>
<div class="sep10"></div>
<div class="sep5"></div>
<span class="fade">{{ site.description }}</span>
View
2  tpl/desktop/rightbar/ads.html
@@ -1 +1 @@
-{% include 'rightbar/adsense.html' %}
+{% include 'rightbar/ads_3cpeijian.html' %}
View
4 tpl/desktop/topic.html
@@ -43,7 +43,7 @@
<div class="fr snow" style="padding-left: 10px; padding-bottom: 10px;"><a href="/member/{{ topic.member.username }}">{{ topic.member|avatar:"large" }}</a></div>
<span class="bigger"><a href="/">{{ site.title }}</a> {{ l10n.chevron }} <a href="/go/{{ node.name}}">{{ node.title|escape }}</a></span>
<h1>{{ topic.title|escape }}</h1>
- <small class="fade">{% if site.use_topic_types %}{% if topic.type %}<span style="display: inline-block; background-color: {{ topic.type_color }}; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; color: #fff; padding: 0px 8px 0px 8px; font-size: 11px;">{{ topic.type }}</span> &nbsp;{% endif %}{% endif %}By <a href="/member/{{ topic.member.username }}" class="dark">{{ topic.created_by }}</a>{% if topic.source %} via {{ topic.source }}{% endif %} at {{ topic.created|timesince }} ago, {{ topic.hits }} hits{% ifequal member.level 0 %} &nbsp; <a href="#;" onclick="if (confirm('{{ l10n.sure_to_delete }} #{{ topic.num }} - {{ topic.title|escape }}')) { location = '/delete/topic/{{ topic.num }}?t={{ member.created_ts }}'; }" class="op">DELETE</a> <a href="/backstage/tidy/topic/{{ topic.num }}" class="op">TIDY</a>{% endifequal %}{% if can_move %} <a href="/backstage/move/topic/{{ topic.key }}" class="op">MOVE</a>{% endif %}{% if can_edit %} <a href="/edit/topic/{{ topic.num }}" class="op">EDIT</a>{% endif %}</small>
+ <small class="fade">{% if site.use_topic_types %}{% if topic.type %}<span style="display: inline-block; background-color: {{ topic.type_color }}; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; color: #fff; padding: 0px 8px 0px 8px; font-size: 11px;">{{ topic.type }}</span> &nbsp;{% endif %}{% endif %}By <a href="/member/{{ topic.member.username }}" class="dark">{{ topic.created_by }}</a>{% if topic.source %} via {{ topic.source }}{% endif %} at {{ topic.created|timesince }} ago{% ifnotequal topic.hits 0 %}, {{ topic.hits }} hits{% endifnotequal %}{% ifequal member.level 0 %} &nbsp; <a href="#;" onclick="if (confirm('{{ l10n.sure_to_delete }} #{{ topic.num }} - {{ topic.title|escape }}')) { location = '/delete/topic/{{ topic.num }}?t={{ member.created_ts }}'; }" class="op">DELETE</a> <a href="/backstage/tidy/topic/{{ topic.num }}" class="op">TIDY</a>{% endifequal %}{% if can_move %} <a href="/backstage/move/topic/{{ topic.key }}" class="op">MOVE</a>{% endif %}{% if can_edit %} <a href="/edit/topic/{{ topic.num }}" class="op">EDIT</a>{% endif %}</small>
</div>{% if topic.has_content %}
<div class="inner">
<div class="content topic_content">{{ topic.content_rendered }}</div>
@@ -141,7 +141,7 @@
{% endif %}
</div>
<div class="cell">
- <textarea class="mll" name="content" id="reply_content" onkeyup="c();"></textarea>
+ <textarea class="mll" name="content" id="reply_content" style="height: 200px;" onkeyup="c();"></textarea>
<div class="sep10"></div>
<div class="fr fade" id="e"></div>
<input type="submit" class="super normal button" value="{{ l10n.send }}" />
View
16 tpl/mobile/index.html
@@ -2,6 +2,7 @@
<body>
{% include 'common/top.html' %}
<div id="Main">
+ {% if member %}{% ifequal member.notifications 0 %}{% else %}<div class="section">提醒</div><div class="cell"><img src="/static/img/dot_orange.png" align="absmiddle" />&nbsp;<strong><a href="/notifications">{{ member.notifications }} 条未读提醒</a></strong></div>{% endifequal %}{% endif %}
<div class="section"><div class="fr"><a href="/recent" class="black">更多最近的 50 个</a></div>最新主题</div>
<div id="topics_index">
{{ home }}
@@ -18,7 +19,20 @@
});
</script>
{% endif %}
- {{ s }}
+ {% if member %}
+ <div class="section">我的收藏</div>
+ <div>
+ <table cellpadding="10" cellspacing="0" border="0" width="100%">
+ <tr>
+ <td width="33%" align="center"><a href="/my/nodes" class="dark" style="display: block;"><span class="bigger">{{ member.favorited_nodes }}</span><div class="sep3"></div><span class="fade">节点收藏</span></a></td>
+ <td width="34%" align="center" style="border-left: 1px solid #ccc; border-right: 1px solid #ccc;"><a href="/my/topics" class="dark" style="display: block;"><span class="bigger">{{ member.favorited_topics }}</span><div class="sep3"></div><span class="fade">主题收藏</span></a></td>
+ <td width="33%" align="center"><a href="/my/following" class="dark" style="display: block;"><span class="bigger">{{ member.favorited_members }}</span><div class="sep3"></div><span class="fade">特别关注</span></a></td>
+ </tr>
+ </table>
+ </div>
+ {% endif %}
+ <div class="section">{{ l10n.nodes_portal }}</div>
+ {{ c }}
</div>
{% include 'common/bottom.html' %}
{% include 'ads/running.html' %}
View
12 tpl/mobile/node.html
@@ -31,6 +31,18 @@
</table>
</div>
{% endfor %}
+ <div class="cell" style="text-align: center;">
+ <div class="fl">{% if has_previous %}
+ <a href="/go/{{ node.name }}?p={{ previous }}">{{ l10n.previous }}</a>
+ {% endif %}</div>
+ <div class="fr">{% if has_more %}
+ <a href="/go/{{ node.name }}?p={{ more }}">{{ l10n.next }}</a>
+ {% endif %}</div>
+ {{ page }}/{{ pages }}
+ </div>
+ {% if node.sidebar %}
+ <div class="cell">{{ node.sidebar }}</div>
+ {% endif %}
</div>
{% include 'common/bottom.html' %}
{% include 'ads/running.html' %}
View
12 tpl/mobile/notifications.html
@@ -0,0 +1,12 @@
+{% include 'common/head.html' %}
+<body>
+ {% include 'common/top.html' %}
+ <div id="Main">
+ <div class="section">提醒系统</div>
+ {% for n in notifications %}
+ <div class="cell"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td width="32" align="left" valign="top"><a href="/member/{{ n.member.username }}">{{ n.member|avatar:"mini" }}</a></td><td valign="top"><span class="fade">{{ n.text }}</span> &nbsp; <span class="snow">{{ n.created|timesince }} ago</span> <a href="/backstage/remove/notification/{{ n.key }}" class="node">删除</a><div class="sep5"></div><div class="payload">{{ n.payload|escape|mentions|urlize|linebreaksbr }}</div></td></tr></table></div>
+ {% endfor %}
+ </div>
+ {% include 'common/bottom.html' %}
+</body>
+</html>
View
5 tpl/mobile/topic.html
@@ -27,7 +27,8 @@
</tr>
</table>
</div>
- <div class="cell">
+ <div class="cell"><div class="fr">{% if topic.stars %}<strong class="fade">已有 {{ topic.stars }} 人收藏 &nbsp; </strong>{% endif %}{% if favorited %}<a href="/unfavorite/topic/{{ topic.num }}?t={{ member.username_lower_md5 }}" class="op">取消收藏</a>{% else %}<a href="/favorite/topic/{{ topic.num }}?t={{ member.username_lower_md5 }}" class="op">加入收藏</a>{% endif %}
+ </div>
<strong class="fade">共收到 {{ topic.replies }} 条回复</strong>
</div>
<script type="text/javascript">
@@ -60,7 +61,7 @@
<span class="fade">现在就加盖一层</span>{% endif %}<form action="/t/{{ topic.num }}" method="post">
<div class="sep5"></div>
<textarea name="content" class="mll">{{ reply_content|escape }}</textarea>
- <div class="sep5"></div>
+ <div class="sep5"></div><div class="fr" style="font-size: 12px; margin-top: 5px; margin-right: 5px;"><a href="/">← {{ site.title }}</a></div>
<input type="submit" value="Reply" />
</textarea></form>
</div>
View
2  v2ex/babel/__init__.py
@@ -1,4 +1,4 @@
-SYSTEM_VERSION = '2.5.0-dev-5'
+SYSTEM_VERSION = '2.5.0-dev-6'
import datetime
import hashlib
View
2  v2ex/babel/handlers/__init__.py
@@ -131,7 +131,7 @@ def finalize(self, template_name, mobile_optimized=False, template_root='desktop
Mobile optimized templates are optional. Default to False.
"""
if self.browser['ios'] and mobile_optimized:
- path = os.path.join(os.path.dirname(__file__), 'tpl', 'mobile', template_name + '.html')
+ path = os.path.join('tpl', 'mobile', template_name + '.html')
else:
path = os.path.join('tpl', template_root, template_name + '.' + template_type)
output = template.render(path, self.values)
View
2  v2ex/templatetags/filters.py
@@ -123,7 +123,7 @@ def youku(value):
if (len(videos) > 0):
for video in videos:
video_id = re.findall('http://v.youku.com/v_show/id_([a-zA-Z0-9\=]+).html', video)
- value = value.replace('http://v.youku.com/v_show/id_' + video_id[0] + '.html', '<embed src="http://player.youku.com/player.php/sid/' + video_id[0] + '/v.swf" quality="high" width="480" height="400" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"></embed>')
+ value = value.replace('http://v.youku.com/v_show/id_' + video_id[0] + '.html', '<embed src="http://player.youku.com/player.php/sid/' + video_id[0] + '/v.swf" quality="high" width="638" height="420" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"></embed>')
return value
else:
return value
Please sign in to comment.
Something went wrong with that request. Please try again.