mixed.diff
1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
diff --git a/codebert/code.py b/codebert/code.py
new file mode 100644
index 0000000..b4bc953
--- /dev/null
+++ b/codebert/code.py
@@ -0,0 +1,21 @@
+def dailymotion_download(url, output_dir='.', merge=True, info_only=False, **kwargs):
+
+ html = get_content(rebuilt_url(url))
+ info = json.loads(match1(html, r'qualities":({.+?}),"'))
+ title = match1(html, r'"video_title"\s*:\s*"([^"]+)"') or \
+ match1(html, r'"title"\s*:\s*"([^"]+)"')
+ title = unicodize(title)
+
+ for quality in ['1080','720','480','380','240','144','auto']:
+ try:
+ real_url = info[quality][1]["url"]
+ if real_url:
+ break
+ except KeyError:
+ pass
+
+ mime, ext, size = url_info(real_url)
+
+ print_info(site_info, title, mime, size)
+ if not info_only:
+ download_urls([real_url], title, ext, size, output_dir=output_dir, merge=merge)
diff --git a/src/train/model.py b/src/train/model.py
index 20e56b3..cab82e5 100644
--- a/src/train/model.py
+++ b/src/train/model.py
@@ -3,9 +3,7 @@
import torch
import torch.nn as nn
-import torch
-from torch.autograd import Variable
-import copy
+
class Seq2Seq(nn.Module):
"""
Build Seqence-to-Sequence.